Closed asifsaho closed 8 years ago
Here is my code
add_action('cmb2_init', function () {
// Start with an underscore to hide fields from custom fields list $prefix = 'presskit-'; /** * Initiate the metabox */ $cmb = new_cmb2_box(array( 'id' => 'presskit-details', 'title' => __('Press Kit Details', 'pressroom'), 'object_types' => array('presskit'), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left // 'cmb_styles' => false, // false to disable the CMB stylesheet //'closed' => true, // Keep the metabox closed by default )); $cmb->add_field(array( 'name' => 'Description', 'desc' => 'Add few words about it', 'id' => $prefix . 'description', 'type' => 'text', )); $cmb->add_field(array( 'name' => 'Description', 'desc' => 'Add few words about it', 'id' => $prefix . 'description', 'type' => 'text', )); $cmb->add_field(array( 'name' => 'Ingredients', 'id' => $prefix . 'ingredients', 'desc' => 'Select ingredients. Drag to reorder.', 'type' => 'pw_multiselect', 'options' => array( 'flour' => 'Flour', 'salt' => 'Salt', 'eggs' => 'Eggs', 'milk' => 'Milk', 'butter' => 'Butter', ), ) );
});
@asifsaho Can you try with the latest release and let me know if you have any further trouble.
Here is my code
add_action('cmb2_init', function () {
});