Home › Forums › Front-end Issues › create new taxonomy with acf form not new post › Reply To: create new taxonomy with acf form not new post
I do not know of any examples.
acf_form(array(
'post__id' => 'new_narocilnice',
'field_groups' => array(
'group_XXXXXXX'
)
));
function new_narocilnice_filter($post_id) {
if ($post_id != 'new_narocilnice') {
return $post_id;
}
// get values for new term from $_POST['acf'] values
// https://developer.wordpress.org/reference/functions/wp_insert_term/
$term = insert_term($term_name, $taxonomy, $other_args);
$post_id = 'term_'.$term=>term_id;
return $post_id;
}
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.