Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $meta_prefix; // In case this needs to be global at some point.
- add_filter( 'cmb_meta_boxes', 'tsgkb_custom_metabox' );
- function tsgkb_custom_metabox( $meta_boxes ) {
- global $meta_prefix;
- /* Problem meta box */
- $meta_boxes[] = array(
- 'id' => 'problem_details',
- 'title' => 'Problem Details',
- 'pages' => array( 'ps_set' ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'show_names' => true,
- 'fields' => array(
- array(
- 'name' => 'Prefix',
- 'id' => $meta_prefix . 'title-prefix',
- 'desc' => 'The prefix is: ' . $meta_prefix,
- 'type' => 'title'
- ),
- array(
- 'name' => 'Product',
- 'id' => $meta_prefix . 'product',
- 'desc' => 'Pick the affected Product',
- 'type' => 'taxonomy_select',
- 'taxonomy' => 'product'
- ),
- array(
- 'name' => 'Sales Name',
- 'id' => $meta_prefix . 'sales-name',
- 'desc' => 'The official Product sales name',
- 'type' => 'taxonomy_select',
- 'taxonomy' => 'sales_name'
- ),
- array(
- 'name' => 'Version',
- 'id' => $meta_prefix . 'version',
- 'desc' => 'Enter the Version',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Area',
- 'id' => $meta_prefix . 'area',
- 'desc' => 'Enter the Area',
- 'type' => 'taxonomy_select',
- 'taxonomy' => 'area'
- ),
- array(
- 'name' => 'TR/CR',
- 'id' => $meta_prefix . 'tr-cr',
- 'desc' => 'Select Trouble Report or Change Request if applicable',
- 'type' => 'radio',
- 'options' => array(
- array( 'name' => 'TR', 'value' => 'tr' ),
- array( 'name' => 'CR', 'value' => 'cr' )
- )
- ),
- array(
- 'name' => 'TR/CR number',
- 'id' => $meta_prefix . 'tr-cr-number',
- 'desc' => 'The number for the TR/CR',
- 'type' => 'text_small'
- ),
- array(
- 'name' => 'Problem Long Text',
- 'id' => $meta_prefix . 'problem-text',
- 'desc' => 'Enter the full details of the problem here.',
- 'type' => 'wysiwyg'
- )
- )
- );
- /* Solution meta box */
- $meta_boxes[] = array(
- 'id' => 'solution_details',
- 'title' => 'Solution Details',
- 'pages' => array( 'ps_set' ),
- 'context' => 'normal',
- 'priority' => 'high',
- 'show_names' => true,
- 'fields' => array(
- array(
- 'name' => 'Workaround',
- 'id' => $meta_prefix . 'workaround',
- 'desc' => 'The Workarond, if applicable',
- 'type' => 'textarea_small'
- ),
- array(
- 'name' => 'Solution Long Text',
- 'id' => $meta_prefix . 'solution-text',
- 'desc' => 'Enter the full details of the solution here.',
- 'type' => 'wysiwyg'
- )
- )
- );
- return $meta_boxes;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment