Skip to content

Instantly share code, notes, and snippets.

@mikemcalister
Created August 3, 2015 16:29
Show Gist options
  • Save mikemcalister/be840ff5cb9243c63bfd to your computer and use it in GitHub Desktop.
Save mikemcalister/be840ff5cb9243c63bfd to your computer and use it in GitHub Desktop.
$project_metaboxes->add_field( array(
'id' => $prefix . 'bundle_items',
'type' => 'group',
'options' => array(
'group_title' => __( 'Bundle Item {#}', 'project' ),
'add_button' => __( 'Add Bundle Item', 'project' ),
'remove_butaton' => __( 'Remove Bundle Item', 'project' ),
'sortable' => false,
),
// Add repeatable bundle item fields
'fields' => array(
array(
'name' => __( 'Bundle Item Title', 'project' ),
'id' => 'bundle_item_title',
'type' => 'text',
),
array(
'name' => __( 'Bundle Item Image', 'project' ),
'id' => 'bundle_item_image',
'type' => 'file',
),
array(
'name' => __( 'Bundle Item Images', 'project' ),
'id' => 'bundle_item_images',
'preview_size' => array( 100, 100 ),
'type' => 'file_list',
),
array(
'name' => __( 'Bundle Item Description', 'project' ),
'description' => __( 'Short description to be displayed on homepage.', 'project' ),
'id' => 'bundle_item_description',
'type' => 'textarea_small',
),
array(
'name' => __( 'Feature on Homepage', 'project' ),
'desc' => __( 'Feature this item's image and description on the homepage.', 'project' ),
'id' => 'bundle_featured_item',
'type' => 'checkbox'
),
),
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment