Created
December 16, 2013 21:33
-
-
Save media317/7994820 to your computer and use it in GitHub Desktop.
Multiple Meta Boxes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Metaboxes | |
* | |
* This file registers any custom metaboxes | |
* | |
* @package Core_Functionality | |
* @since 1.0.0 | |
* @link https://github.com/billerickson/Core-Functionality | |
* @author Bill Erickson <[email protected]> | |
* @copyright Copyright (c) 2011, Bill Erickson | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
*/ | |
/** | |
* Create Metaboxes | |
* @since 1.0.0 | |
* @link http://www.billerickson.net/wordpress-metaboxes/ | |
*/ | |
function be_metaboxes( $meta_boxes ) { | |
$meta_boxes[] = array( | |
'id' => 'staff-information', | |
'title' => 'Staff', | |
'pages' => array('staff'), | |
'context' => 'normal', | |
'priority' => 'high', | |
'show_names' => true, | |
'fields' => array( | |
array( | |
'name' => 'ID Code', | |
'desc' => 'ID Code for this person from Causeview', | |
'id' => 'mmi_idcode', | |
'type' => 'text' | |
), | |
'id' => 'project-details', | |
'title' => 'Project Details', | |
'pages' => array('projects'), | |
'context' => 'normal', | |
'priority' => 'high', | |
'show_names' => true, | |
'fields' => array( | |
array( | |
'name' => 'GL Code', | |
'desc' => 'GL Code for this Project', | |
'id' => 'mmi_glcode', | |
'type' => 'text' | |
), | |
), | |
); | |
return $meta_boxes; | |
} | |
add_filter( 'cmb_meta_boxes' , 'be_metaboxes' ); | |
/** | |
* Initialize Metabox Class | |
* @since 1.0.0 | |
* see /lib/metabox/example-functions.php for more information | |
* | |
*/ | |
function be_initialize_cmb_meta_boxes() { | |
if ( !class_exists( 'cmb_Meta_Box' ) ) { | |
require_once( BE_DIR . '/lib/metabox/init.php' ); | |
} | |
} | |
add_action( 'init', 'be_initialize_cmb_meta_boxes', 9999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment