Home › Forums › Backend Issues (wp-admin) › How to display dynamicly ACF Fields on change Taxonomy in post-edit ? › Reply To: How to display dynamicly ACF Fields on change Taxonomy in post-edit ?
the problem is that you are looking at the actual term currently set for the post that is stored by WP.
$main_post_cat = noir_get_team_term($options['post_id'], "team_category", 'slug');
You need to look at this, but you also need to check to see if ACF has included the currently selected therm in the $options
that it is passing to the filter. This is actually more important then testing the posts current terms, but you need to do both, first checking the $options
and if it is not set or it is empty then checking against the post’s current terms.
If nothing has changed since the last time I created a custom location rule then the terms selected will be in $options['taxonomy']
One of my old examples shows this https://github.com/Hube2/acf-filters-and-functions/blob/master/acf-post-category-ancestor-location-rule.php
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.