Hi there,
First, I do have WP_DEBUG
set to true on my development site, which I think anyone who is developing themes or plugins should have.
Secondly, I have created a custom post type. It is all set up and working beautifully thanks to your Custom Post Type plugin.
OK, so I wanted to try and use the Image Advanced
field for a certain part of the custom post type and I added the following:
$images = rwmb_meta( 'info', array( 'limit' => 1 ) );
$image = reset( $images );
This of course comes from the docs: https://docs.metabox.io/fields/image-advanced/#template-usage.
I changed it to this:
$images = rwmb_meta( 'tp_primo_header_background',array( 'size' => 'full' ) );
$image = reset( $images );
which is supposed to return the full size image. The image displays properly the way it's supposed to in the custom post type...awesome.
However, when you I view a regular post or page, which of course is not the custom post type, I get the following warning:
Warning: reset() expects parameter 1 to be array, string given in /the file where the code is added on line 8
I know if I turn off WP_DEBUG
the warning message will go away but I am curious as to how can I get rid of that warning altogether?
Thanks in advance for any help.