Home › Forums › Front-end Issues › Display ACF fields that are modified by filters › Reply To: Display ACF fields that are modified by filters
To be honest, I’m a little confused whey your are doing this
$field = get_field_object( 'custom_field) );
$value = get_post_meta( $post_id, 'custom_field', true );
echo $field['choices'][ $value ];
Why get the field object, then get the meta value and then output echo the label.
Set the field to either return the label or to return and array with value/label and then use
// set to return label
the_field('custom_field')
or
// set to return both
$value = get_field('custom_field');
echo $value['lable'];
back to your question. If the values choices are not being set when you call get_field_object() then that means that your filter is not being called. Where/in what file/when is your load filter being called?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.