Support

Account

Home Forums Backend Issues (wp-admin) Need a solution for a single True/False Field to set a stored taxonomy term Reply To: Need a solution for a single True/False Field to set a stored taxonomy term

  • Thank you @hube2 , that’s completely true!
    In the meantime I found a solution that works for me. If anyone else needs it:

    
    function update_post_taxonomy( $post_id ) {
    $myfield = get_field('my_field_name');
    if( $myfield ) {
    wp_set_object_terms($post_id, 'myterm', 'mytaxonomy', true);
    }
    add_action('acf/save_post', 'update_post_taxonomy', 20);
    

    Cheers!