Taxonomy not saved when creating new custom post
Hi.
I have three taxes, shown by meta box in my custom post type. Custom post type created via Toolset Types plugin.
So, when i create new post and select one term of my tax, selection is not saved. But, if i do it in second time, selection is saved.
PS: wordpress 4.7.3, meta box 4.10.4, toolset types 2.2.9
Can you post your code and screenshot?
PS: Have you tried MB Custom Post Type extension? It creates custom post types for you. And it's built on Meta Box and very lightweight.
Code is above:
add_filter( 'rwmb_meta_boxes', 'new_tax_meta_boxes' );
function new_tax_meta_boxes( $meta_boxes ) {
$meta_boxes[] = array(
'title' => __( 'Выберите Страну, Регион или Город', 'textdomain0' ),
'post_types' => 'offers',
'fields' => array(
array(
'name' => esc_html__( 'Город', 'textdomain1' ),
'id' => "taxonomy_1",
'type' => 'taxonomy',
'taxonomy' => 'cities',
'field_type' => 'select_tree',
'query_args' => array(),
),
array(
'name' => esc_html__( 'Регион', 'textdomain2' ),
'id' => "taxonomy_2",
'type' => 'taxonomy',
'taxonomy' => 'regions',
'field_type' => 'select',
'query_args' => array(),
),
array(
'name' => esc_html__( 'Страна', 'textdomain3' ),
'id' => "taxonomy_3",
'type' => 'taxonomy',
'taxonomy' => 'countries',
'field_type' => 'select',
'query_args' => array(),
),
),
);
return $meta_boxes;
}
Screenshot (new post in a custom post type)

Nut sure why this is. Maybe the taxonomies aren't available yet when the terms are trying to be saved.
same problem but: Terms are sometimes saved and sometimes not. From what i see it random ;/ and when i add 'clone' => true after save i get wall with :
Notice: Array to string conversion in /srv/www/holistic/public_html/wp-content/plugins/meta-box/inc/fields/taxonomy-advanced.php on line 43
Think the problem is from line 80 of meta-box/inc/fields/taxonomy-advanced.php.
Think it should be checking for 'cloned' parameter, in addition to the 'multiple' parameter.
Result:
return ($field['multiple'] || $field['clone']) ? $meta : reset( $meta );
@Karuma taxonomy fields shouldn't be cloned, as it isn't supported
I have the same issue, When I make custom page + select tree view taxonomy, I cant save my post. Any idea where is the reason? Latest version of all.
Thanks