Support › General › Clonable post type field count not zero with nothing selectedResolved
I'm using post type metabox with 'clone' and 'sort' option.
I haven't selected any posts, but rgm_meta has zeros in the array.
Get filed Value:
$posts_related = rwmb_meta( 'post_related', array(), $id );
I want the array to be empty if nothing is selected.
'id' => 'post_related',
'type' => 'post',
'name' => 'title',
'post_type' => array(
0 => 'post-type-1',
1 => 'post-type-2',
2 => 'post-type-3',
'field_type' => 'select_advanced',
'clone' => 1,
'sort_clone' => 1,
*I can select multiple in Select Advanced, but I can't change the order, so I use a 'clone'.
Hi, thanks a lot for your feedback. It's a bug in the sanitization callback, which I've just fixed here. Please try it.
I'm thankful for your quick debugging.
When I was save post again, I could confirm that post type select field array value is emptied.