Home › Forums › Backend Issues (wp-admin) › Linking ACF Taxonomy to WP Taxonomy on programmatic save/insert › Reply To: Linking ACF Taxonomy to WP Taxonomy on programmatic save/insert
I don’t think there is a function you can call to do this. When you set the save/load terms options for a taxonomy field ACF calls WP functions with the right info to make this happen.
When saving the field ACF calls wp_set_object_terms() https://codex.wordpress.org/Function_Reference/wp_set_object_terms
When loading the field ACF calls wp_get_object_terms() https://codex.wordpress.org/Function_Reference/wp_get_object_terms
You can get more information about what ACF is doing by looking at the file for the taxonomy field /advanced-custom-fields-pro/includes/fields/class-acf-field-taxonomy.php.
I think that in order to do what you want that you’ll need to call these WP functions yourself.
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 most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.