jaredatch/Custom-Metaboxes-and-Fields-for-WordPress — Issue #104: Meta Box not showing up?
Author: berfarah
Created: 2012-01-31 20:28:44+00:00
State: open

I'm sorry if it turns out that I'm just really dumb and I waste your time, but I have stared at this for hours and cannot for the life of me figure out what I did wrong or if it's potentially a bug.

I put this in my functions.php

require_once('includes/metaboxes/init.php');

// Instrument
$prefix = 'about_'; // Prefix for the fields
function add_instrument_metabox( $meta_boxes ){
global $prefix;
$meta_boxes[] = array(
'id'	=> 'instrument_metabox',
'title'	=> 'Instrument',
'pages'	=> array('page'), // post type
'show_on'	=> array( 'key' => 'page-template', 'value' => 'about-fugata.php' ),
'context'	=> 'normal',
'priority'	=> 'high',
'show_names'	=> true, // Show field names on the left
'fields'	=> array(
array(
'name'	=> 'Person\'s Instrument',
'desc'	=> '',
'id'	=> $prefix . 'instrument',
'type'	=> 'text'
),
),
);

return $meta_boxes;
}
add_filter( 'cmb_meta_boxes', 'add_instrument_metabox' );

// Initialize Instrument Metabox
function create_instrument_metabox(){
if(!class_exists('cmb_Meta_Box')){
require_once('includes/metaboxes/init.php');
}
}
add_action('init','create_instrument_metabox', 9999);

I can 100% confirm that the template is called about-fugata.php, and that it is a page. Am I missing something or did I break it?