Support Meta Box Builder Custom Taxonomy and Advanced Taxonomy Reply To: Custom Taxonomy and Advanced Taxonomy

#13977
Anh TranAnh Tran
Keymaster

Hi, I think that's doable with some hook.

Like you use a taxonomy_advanced to save the term IDs in the custom table. Then you hook to "after save post" to set the terms for the post.

This is what I have in my mind:

add_action( 'rwmb_YOURFIELD_after_save_field', function ( $null, $field, $new, $old, $post_id ) {
    $taxonomy = reset( $field['taxonomy' );
    wp_set_object_terms( $post_id, $new, $taxonomy );
}, 10, 5 );

Change YOURFIELD to your field ID.