Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Repeatable Field Groups
- */
- $meta_boxes['field_group'] = array(
- 'id' => 'field_group',
- 'title' => __( 'Details', 'cmb' ),
- 'pages' => array( 'post', ),
- 'fields' => array(
- array(
- 'id' => $prefix . 'repeat_group',
- 'type' => 'group',
- 'description' => __( 'What are included in this service', 'cmb' ),
- 'options' => array(
- 'group_title' => __( 'Entry {#}', 'cmb' ), // {#} gets replaced by row number
- 'add_button' => __( 'Add Another Entry', 'cmb' ),
- 'remove_button' => __( 'Remove Entry', 'cmb' ),
- 'sortable' => true, // beta
- ),
- // Fields array works the same, except id's only need to be unique for this group. Prefix is not needed.
- 'fields' => array(
- array(
- 'name' => 'Description',
- 'description' => 'Write a short description for this entry',
- 'id' => 'description',
- 'type' => 'textarea_small',
- ),
- ),
- ),
- ),
- );
- /**
- * Pricing metabox
- */
- $meta_boxes['test_metabox'] = array(
- 'id' => 'test_metabox',
- 'title' => __( 'Pricing', 'cmb' ),
- 'pages' => array( 'post', ), // Post type
- 'context' => 'normal',
- 'priority' => 'high',
- 'show_names' => true, // Show field names on the left
- // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend
- 'fields' => array(
- array(
- 'name' => __( 'Quote', 'cmb' ),
- 'desc' => __( 'field description (optional)', 'cmb' ),
- 'id' => $prefix . 'test_textmoney',
- 'type' => 'text_money',
- // 'before' => '£', // override '$' symbol if needed
- // 'repeatable' => true,
- ),
- ),
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement