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
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!
🚨 The 2023 ACF Annual Survey closes tomorrow! This is your last chance to complete the survey and help guide the evolution of ACF. https://t.co/0cgr9ZFOJ5— Advanced Custom Fields (@wp_acf) May 18, 2023
© 2023 Advanced Custom Fields.