Home › Forums › Front-end Issues › Populate Taxonomy ID dynamically › Reply To: Populate Taxonomy ID dynamically
If the data isn’t sent from the form, you can dump out the post value before your code and see what’s the actual key is. (maybe there’s a typo in your field key)
echo '<pre>';
print_r($_POST['acf']);
echo '</pre>';
Another reason might be, the form is sending the value as a string, but the wp functions requires a pure integer. See last example in the doc, https://codex.wordpress.org/Function_Reference/wp_set_post_terms
So, your code might even need to cast the value with intval
first.
'custom_tax_tag => array( intval($_POST['acf']['field_5a903d3132d04']) )
Cheers
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.