Sorry Nuro, I have another question.
I want to get all the values of the field ‘hair_color’.
Is in a generic page to make a combobox to use it as a filter, so I need all the values. I don’t have the term-id value.
Thanks in advance
Ok, it works that way:`
$fieldf = get_field_object('hair_color', $taxonomy . '_' . $term->term_id);
$field = get_field('hair_color', $taxonomy . '_' . $term->term_id);
$value = $fieldf['choices'][ $field ];
echo $value`
Thank you so much for your help
Hi,
Thank you, but I get an empty value.
a var_dump($field) is empty too.
This is the return:
array(17) { [“key”]=> string(16) “field_hair_color” [“label”]=> string(0) “” [“name”]=> string(10) “hair_color” [“type”]=> string(4) “text” [“order_no”]=> int(1) [“instructions”]=> string(0) “” [“required”]=> int(0) [“id”]=> string(20) “acf-field-hair_color” [“class”]=> string(4) “text” [“conditional_logic”]=> array(3) { [“status”]=> int(0) [“allorany”]=> string(3) “all” [“rules”]=> int(0) } [“default_value”]=> string(0) “” [“formatting”]=> string(4) “html” [“maxlength”]=> string(0) “” [“placeholder”]=> string(0) “” [“prepend”]=> string(0) “” [“append”]=> string(0) “” [“value”]=> bool(false) } 3
Thanks