Using:
Meta Box - 5.10.4
Meta Box Group – 1.4.4 – Nov 19, 2024
– MB Group with clone=true when save will auto create empty item at first array.
https://prnt.sc/xpzW508AyTYX
– Image Advanced / Image field not display after save when have value
https://prnt.sc/5UpqQON3u6Bn
I Downgrade Meta Box to v5.5.1, Image field display value again, but empty item at first array still happen.
Sample Code:
<div>add_filter( 'rwmb_meta_boxes', 'hrm_register_meta_boxes' );
function hrm_register_meta_boxes( $meta_boxes ){
$meta_boxes[] = array(
'title' => __( 'Page Setting Content', 'hrm' ),
'pages' => array( 'page' ),
'id' => 'Home-Page-Setting-Content',
'show' => array('template' => array( 'template-home.php' )),
'fields' => array(
[
'type' => 'heading',
'name' => 'Home Slide',
],
[
'id' => 'home_slide',
'type' => 'group',
'clone' => true,
'sort_clone' => true,
'collapsible' => true,
'default_state' => 'collapsed',
'group_title' => '#{#}: {title}',
'fields' => [
[
'name' => 'Title',
'id' => 'title',
'type' => 'text',
],
[
'name' => 'Description',
'id' => 'desc',
'type' => 'textarea',
],
[
'name' => 'Button Text',
'id' => 'button_text',
'type' => 'text',
],
[
'name' => 'Button Url',
'id' => 'button_link',
'type' => 'textarea',
],
[
'id' => 'bg_desk',
'name' => 'Background Desktop',
'type' => 'image_advanced',
'max_file_uploads' => 1,
],
[
'id' => 'bg_mobi',
'name' => 'Background Mobile',
'type' => 'image_advanced',
'max_file_uploads' => 1,
],
],
],
),
);
return $meta_boxes;
}
</div>