Skip to content

Instantly share code, notes, and snippets.

@brandondove
Created April 19, 2016 00:11
Show Gist options
  • Save brandondove/5e72f7497bbb01a6c1962c9d3846827e to your computer and use it in GitHub Desktop.
Save brandondove/5e72f7497bbb01a6c1962c9d3846827e to your computer and use it in GitHub Desktop.
<?php
$product_meta_box = new_cmb2_box( array(
'id' => 'product_meta_box',
'title' => __( 'Product Details', 'sample' ),
'object_types' => array( 'product' ),
'context' => 'normal',
'priority' => 'high',
'show_names' => true,
) );
$product_meta_box->add_field( array(
'name' => __( 'Subheader', 'sample' ),
'id' => 'product-subheader',
'type' => 'text',
) );
$case_study_options = array();
$cast_studies = array(
'1' => 'Rad Case Study',
'2' => 'Wicked Case Study',
'3' => 'Cool Case Study',
);
$case_study_options['add_row_text'] = __( 'Add Case Study', 'sample' ); // Ruh Roh
$product_meta_box->add_field( array(
'name' => __( 'Case Study', 'sample' ),
'id' => 'prouct-case-study',
'type' => 'select',
'show_option_none' => true,
'repeatable' => true,
'options' => $case_study_options,
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment