Support Forum
Hi there,
I noticed a new bug that appears after upgrading the meta box plugin.
Any image being output that's been uploaded under MB Settings Page now triggers some warnings and errors.
I'm using this code snippet from the docs
$settings = get_option( 'option_name' );
$image_ids = $settings['images'];
foreach ( $image_ids as $image_id ) {
$image = RWMB_Image_Field::file_info( $image_id, array( 'size' => 'thumbnail' ) );
echo '<img src="' . $image['url'] . '">';
}
Now triggers this error:
Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/theme-name/wp-content/plugins/meta-box/inc/fields/image.php on line 166
Could you please advise? Thank you