Home › Forums › Backend Issues (wp-admin) › Change taxonomy on Load_field problem! › Reply To: Change taxonomy on Load_field problem!
Hey, sorry for the delayed response, for some reason my notifications on many discussions has got turned off.
I found the example code that I used. Different taxonomies but it is working.
function get_current_taxonomy( $field ) {
global $post;
if ('publication' === $post->post_type) {
$field['taxonomy'] = 'publication-type';
}
if ('post' === $post->post_type) {
$field['taxonomy'] = 'category';
}
return $field;
}
add_filter('acf/load_field/key=field_558aa7b9f6168', 'get_current_taxonomy');
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.