Hello,
I see there are two issues in the code that you create to output the field value:
1. Missing the closing square bracket:
- current:
$image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' );
- it should be:
$image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' ] );
2. Missing the field prefix when accessing the subgroup and subfields, for example:
- current:
// Field image:
$image_ids = $subgroup[ 'image' ] ?? [];
- it should be:
// Field title:
echo $subgroup[ 'ie-slider-title' ] ?? '';
The correct code is:
$groups = rwmb_meta( 'ie-slider-sliders' );
foreach ( $groups as $group ) {
// Field slider:
$subgroups = $group[ 'ie-slider-slider' ] ?? '';
foreach ( $subgroups as $subgroup ) {
// Field title:
echo $subgroup[ 'ie-slider-title' ] ?? '';
// Field image:
$image_ids = $subgroup[ 'ie-slider-image' ] ?? [];
?>
<h3>Uploaded images</h3>
<ul>
<?php foreach ( $image_ids as $image_id ) : ?>
<?php $image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' ] ); ?>
<li><img src="<?php echo $image['url']; ?>"></li>
<?php endforeach ?>
</ul>
<?php
// Field caption:
echo $subgroup[ 'ie-slider-caption' ] ?? '';
// Field description:
$values = $subgroup[ 'ie-slider-description' ] ?? '';
foreach ( $values as $value ) :
echo do_shortcode( wpautop( $value ) );
endforeach;
}
}