Wednesday, May 4, 2016

WP ACF - ideally, you should be using keys instead of field names in ACF's CRUD methods

If you rely on field name, instead of field key, your CRUD operations (add_row, update_field, etc) might silently fail (by just returning false).

For example:

//this can silently fail returning FALSE:
$field_key = "org_shareholders";

//this should always work:
$field_key = "field_5717fad0e2885";

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...