Home › Forums › Front-end Issues › Update post field › Reply To: Update post field
It should look something like this
$my_post['tax_input'] = array(
'category' => array(
get_field('categorie', $post_id)
)
);
see https://developer.wordpress.org/reference/functions/wp_insert_post/. Each element of ‘tax_input’ is an array. The key is the taxonomy name and the value is an array of term IDs.
Although I’m not 100% sure that tax_input works with wp_update_post. You may need to use wp_set_object_terms() https://developer.wordpress.org/reference/functions/wp_set_object_terms/
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.