I’m registering my metaboxes as a plugin. Perhaps this is contributing to the fatal error? Thank you for looking at this.
<?php
/*
Plugin Name: Metabox Instances
Version: 1.0.1
Author: Martin Schapiro
*/
function my_scholarship_styles() {
$themeVersion = wp_get_theme()->get('Version');
// Enqueue our style.css with our own version
wp_enqueue_style('plugin-scholarship-style', plugin_dir_url( __FILE__ ) . '/style.css',
array(), $themeVersion);
}
// Enqueue this theme's scripts and styles (after parent theme)
add_action('wp_enqueue_scripts', 'my_scholarship_styles', 20);
add_filter( 'rwmb_meta_boxes', 'SCHOLARSHIPPAGE_register_meta_boxes' );
function SCHOLARSHIPPAGE_register_meta_boxes( $meta_boxes ) {
$prefix = '_rw_';
// 1st meta box
$meta_boxes[] = array(
'id' => 'scholarships',
'title' => __( 'Scholarshop Applicants' ),
'post_types' => array( 'page' ),
'context' => 'normal',
'priority' => 'high',
'include' => array(
'template' => 'page-scholarshipnew.php',
),
'fields' => array(
array(
'id' => 'standard',
// Gropu field
'type' => 'group',
// Clone whole group?
'clone' => true,
// Drag and drop clones to reorder them?
'sort_clone' => true,
// Sub-fields
'fields' => array(
array(
'name' => __( 'Full name', 'textdomain' ),
'desc' => 'Format: First Last',
'id' => $prefix . 'fname',
'type' => 'text',
'class' => 'scholarship-name',
'clone' => false,
),
array(
'name' => __( 'Headshot', 'textdomain' ),
'desc' => 'Will be cropped square',
'id' => $prefix . 'headshot',
'type' => 'file_input',
'class' => 'scholarship-headshot',
'clone' => false,
),
array(
'name' => __( 'link', 'textdomain' ),
'desc' => 'full URL with http://',
'id' => $prefix . 'link',
'type' => 'text',
'class' => 'scholarship-link',
'clone' => false,
),
array(
'name' => __( 'Hometown', 'textdomain' ),
'desc' => 'eg: Tucson, AZ',
'id' => $prefix . 'hometown',
'type' => 'text',
'class' => 'scholarship-town',
'clone' => false,
),
array(
'name' => __( 'Vocal Range', 'textdomain' ),
'desc' => 'Alto, Tenor, Soprano, Baritone, Vocal Percussionist, etc.',
'id' => $prefix . 'range',
'type' => 'text',
'class' => 'scholarship-range',
'clone' => false,
),
),
),
),
);
return $meta_boxes;
}
?>