Created
July 23, 2015 19:32
-
-
Save kellenmace/78265787113b9eeb1592 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 | |
function hmc_metaboxes( array $meta_boxes ) { | |
$meta_boxes['home_metabox'] = array( | |
'id' => '_hmc_home_metabox2', | |
'title' => __( 'Key Facts', 'hmc' ), | |
'pages' => array( 'page' ), | |
'show_on' => array( 'key' => 'page-template', 'value' => 'templates/home-page.php' ), | |
'context' => 'normal', | |
'priority' => 'default', | |
'show_names' => true, | |
'fields' => array( | |
array( | |
'id' => '_hmc_key_facts', | |
'type' => 'group', | |
'description' => __( 'Add key facts for the circles', 'hmc' ), | |
'options' => array( | |
'group_title' => __( 'Key Fact {#}', 'hmc' ), | |
'add_button' => __( 'Add Another Key Fact', 'hmc' ), | |
'remove_button' => __( 'Remove Key Fact', 'hmc' ), | |
'sortable' => true, | |
), | |
'fields' => array( | |
array( | |
'name' => 'Number', | |
'id' => 'number', | |
'type' => 'text_small', | |
'attributes' => array( | |
'placeholder' => '15%' | |
) | |
), | |
array( | |
'name' => 'Text', | |
'id' => 'text', | |
'type' => 'text_medium', | |
'attributes' => array( | |
'placeholder' => 'Invested in research' | |
) | |
), | |
), | |
), | |
), | |
); | |
add_action( 'init', 'hmc_initialize_cmb_meta_boxes', 9999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment