Well I think I finally figured out why these boxes were ever made in the first place: the only thing that has the ids that are in the metaboxes file is an old theme that isn’t in use anymore, so I believe it is fully deprecated and I’m ready to wash my hands of it. Again, thank you very much, you pointed me in directions I never would’ve looked and this would’ve taken me days of frustration otherwise. I already typed out everything below before I figured that out though so if you’re curious:
PHP Fatal error: Uncaught Error: Call to a member function add_field() on array in /nas/content/staging/[site]/wp-content/mu-plugins/core-functionality/functions/metaboxes.php:40
Stack trace:
#0 /nas/content/staging/[site]/wp-includes/class-wp-hook.php(287): be_metaboxes(Array)
#1 /nas/content/staging/[site]/wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)
#2 /nas/content/staging/[site]/wp-content/plugins/cmb2/bootstrap.php(42): apply_filters('cmb2_meta_boxes', Array)
#3 /nas/content/staging/[site]/wp-content/plugins/cmb2/init.php(165): cmb2_bootstrap()
#4 /nas/content/staging/[site]/wp-includes/class-wp-hook.php(287): CMB2_Bootstrap_270->include_cmb('')
#5 /nas/content/staging/[site]/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#6 /nas/content/staging/[site]/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#7 /nas/content/staging/[site]/wp-settings.php(546): do_action('init')
#8 /nas/content/staging/[site]/nas/content/staging/[site]/wp-content/mu-plugins/core-functionality/functions/metaboxes.php on line 40, referer: https://[mysite].staging.wpengine.com/wp-admin/
Line 40 is $meta_boxes->add_field( array(
and for context, below is how the first few sections of metaboxes.php are set up. I suspect that, probably among other things, the ‘fields’ => array is wrong because I don’t see that anywhere in the guides; I’m guessing it was done this way to group them together but I can’t make heads or tails of how to change it.
add_filter( 'cmb2_meta_boxes' , 'be_metaboxes' );
/**
* Create Metaboxes
* @since 1.0.0
* @link https://www.billerickson.net/wordpress-metaboxes/
*/
function be_metaboxes( $meta_boxes ) {
$meta_boxes->add_field( array(
'id' => 'product-information',
'title' => 'Product Information',
'object_types' => array( 'product' ),
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
'fields' => array(
array(
'name' => 'The Details',
'desc' => '',
'id' => 'be_product_details',
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 5,
)
),
array(
'name' => 'The Fit',
'desc' => '',
'id' => 'be_product_fit',
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 5,
)
),
array(
'name' => 'Set Page Background to Non-White',
'desc' => '',
'id' => 'be_product_white_bg',
'type' => 'checkbox',
)
)
));
$meta_boxes->add_field( array(
'id' => 'archive-information',
'title' => 'Archive Information',
'object_types' => array( 'product' ),
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
'fields' => array(
array(
'name' => 'Title',
'desc' => 'Used on category and related post listings. If not provided, defaults to page title',
'id' => 'be_archive_title',
'type' => 'text',
),
array(
'name' => 'Description',
'desc' => 'Used on category and related post listings. If not provided, defaults to Summary from Product Information.',
'id' => 'be_archive_desc',
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 2,
),
),
)
));