Hy,
I am using the ACF taxonomy field in a front end form, to populate the dropdown select box with the custom taxonomies i created earlier.
The problem is that the taxonomy gets saved in the form, but not in the side bar.
Please see this image : [removed]
In functions.php i have added the code :
function my_post_title_updater( $post_id ) {
if ( get_post_type( $post_id ) == ‘item’ ) {
$my_post = array();
$my_post[‘ID’] = $post_id;
$my_post[‘post_title’] = get_field( ‘titlu’, $post_id );
$my_post[‘post_name’] = get_field( ‘titlu’, $post_id );
$my_post[‘post_content’] = get_field( ‘descriere’, $post_id );
$my_post[‘tax_input[cat]’] = get_field( ‘categorie’, $post_id );
wp_update_post( $my_post );
}
}
// run after ACF saves the $_POST[‘fields’] data
add_action(‘acf/save_post’, ‘my_post_title_updater’, 20);
But it is not working
My plan is to have the user submit the form on front end, and thenset the CATEGORIE taxonomie in the form field, and in the sidebar.
My taxonomie name is ‘cat’ and the field is called ‘categorie’
Can anyone help me?
Thnak you!