-
-
Save billerickson/7996137 to your computer and use it in GitHub Desktop.
This file contains 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 <bill@billerickson.net> | |
* @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' | |
), | |
), | |
); | |
$meta_boxes[] = array( | |
'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