I am using the Advanced Custom Fields plugin and want to read the value of the custom fields. For dropdown and text fields, this is straightforward as the value is kept in plain text, so the
get_post_custom_values functions works.
For multi-select field, however, ACF keeps data like this:
So the sensible thing to do is to use the
get_value function from ACF to read the value and parse it into objects.
In the ACF plugin, the first line does:
$acf = new Acf();
So I assumed I could just use the $acf variable in my plugin and do:
$afc->get_value ($post_id, $key);
but received error with
PHP Notice: Undefined variable
I am new to php development so I might not have understood the scoping rule correctly. So, what's the right way to do this and what am I doing wrong?