Hello, I have a problem with the image field, using the example below when editing a post and change any other field and post update the image that is saved in image fields are lost.
function your_prefix_get_meta_box( $meta_boxes ) {
$prefix = 'prefix-';
$meta_boxes[] = array(
'id' => 'untitled',
'title' => esc_html__( 'Untitled Metabox', 'metabox-online-generator' ),
'post_types' => array( 'post', 'page' ),
'context' => 'advanced',
'priority' => 'default',
'autosave' => false,
'fields' => array(
array(
'id' => $prefix . 'text_1',
'type' => 'text',
'name' => esc_html__( 'Text', 'metabox-online-generator' ),
),
array(
'id' => $prefix . 'image_select_2',
'type' => 'image_select',
'name' => esc_html__( 'Image Select', 'metabox-online-generator' ),
'force_delete' => false,
'max_file_uploads' => '4',
),
array(
'id' => $prefix . 'image_4',
'type' => 'image',
'name' => esc_html__( 'Image Upload', 'metabox-online-generator' ),
),
),
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'your_prefix_get_meta_box' );