Support Forum
With debug logging enabled every page is reporting these errors:
Notice: Undefined index: fields in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 67
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 383
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box-aio/vendor/meta-box/meta-box-columns/class-mb-columns-processor.php on line 106
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 112
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 84
Notice: Undefined index: fields in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 67
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 383
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box-aio/vendor/meta-box/meta-box-columns/class-mb-columns-processor.php on line 106
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 112
Warning: Invalid argument supplied for foreach() in /nas/content/live/devmyswitchboa/wp-content/plugins/meta-box/inc/meta-box.php on line 84
Hi Peter,
These errors happen because some meta box is mis-configured. Please check the code for meta box registration to make sure it follows the docs. These are usual problems:
$meta_boxes
variable from the callback for the rwmb_meta_boxes
filter.Hi,
For point 1, I was following your example here - and it would presumably not be possible to return the $meta_boxes
variable as we've called die/exit.
And I'm sorry but I don't understand your second point - I copied and pasted the output from the builder into my functions.php and then deleted the fieldset from the builder. How could I be missing fields? I'll delete everything and slowly reintroduce things to see if I can narrow the problem down.
Thanks,
Pete
All of the above errors occurred because there was an element missing from the properties array: 'fields' => array()
:
$meta_boxes[] = array (
'title' => 'Log Book',
'id' => 'log-book',
'post_types' => array(
0 => 'log_book',
),
'context' => 'normal',
'priority' => 'high',
'fields' => array()
);
I had an empty meta-box configured, as I wanted to use the front-end form for this type but only for the default WordPress editor/title.
Hi Peter,
Glad that you found the problem. That's what I said in the previous comment. However, I've added a simple check for the Meta Box plugin that allows you to have a meta box with no fields. Try it here.