本文整理汇总了PHP中new_cmb2_box函数的典型用法代码示例。如果您正苦于以下问题:PHP new_cmb2_box函数的具体用法?PHP new_cmb2_box怎么用?PHP new_cmb2_box使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了new_cmb2_box函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: seventeen_register_exhibition_dates
function seventeen_register_exhibition_dates()
{
$prefix = '_seventeen_';
$exhibition_dates = new_cmb2_box(array('id' => $prefix . 'exhibition_dates', 'title' => __('Exhibition Dates', 'seventeen'), 'object_types' => array('exhibitions'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
$exhibition_dates->add_field(array('name' => __('Start Date', 'seventeen'), 'desc' => __('The date the exhibition opens', 'seventeen'), 'id' => $prefix . 'startdate', 'type' => 'text_date_timestamp', 'date_format' => __('d-m-Y', 'seventeen')));
$exhibition_dates->add_field(array('name' => __('End Date', 'seventeen'), 'desc' => __('The date and time the exhibition closes', 'seventeen'), 'id' => $prefix . 'enddate', 'type' => 'text_datetime_timestamp', 'date_format' => __('d-m-Y', 'seventeen')));
}
示例2: webinar_mb
function webinar_mb($meta_boxes)
{
$prefix = "";
$webinar = new_cmb2_box(array('id' => 'webinar-data', 'title' => 'Webinar Details', 'object_types' => array('citrix_webinar'), 'show_on' => array(), 'context' => 'side', 'priority' => 'default', 'show_names' => true));
$webinar->add_field(array('name' => 'Webinar Key', 'id' => $prefix . 'webinar_key', 'type' => 'text', 'default' => get_old_webinar_key(), 'options' => array()));
$webinar->add_field(array('name' => 'PDF Url', 'id' => $prefix . 'webinar_pdf', 'type' => 'file', 'default' => get_old_pdf_value(), 'options' => array()));
}
示例3: fields
/**
* Add custom fields to the CPT
*
* @since 0.1.0
* @return void
*/
public function fields()
{
$prefix = 'wds_announcements_';
$cmb = new_cmb2_box(array('id' => $prefix . 'metabox', 'title' => __('WDS Announcements Meta Box', 'wds-announcements'), 'object_types' => array('wds-announcements'), 'context' => 'normal', 'priority' => 'high'));
// Regular text field
$cmb->add_field(array('name' => __('Link URL', 'cmb2'), 'desc' => __('(optional) e.g. http://www.lifehacker.com', 'cmb2'), 'id' => $prefix . 'url', 'type' => 'text_url'));
}
示例4: register_metabox
/**
* Add the metabox
* @since 0.1.0
*/
public function register_metabox()
{
// Start with an underscore to hide fields from custom fields list
$prefix = '_wds_ratings_';
$cmb = new_cmb2_box(array('id' => $prefix . 'metabox', 'title' => __('WDS Ratings', 'wds_ratings'), 'object_types' => array('page', 'post'), 'context' => 'side', 'show_names' => false));
$cmb->add_field(array('desc' => $this->filter_label(), 'id' => $prefix . 'filter', 'type' => 'checkbox'));
}
示例5: ht_kb_voting_meta_boxes
/**
* Register meta boxes
* @uses the meta-boxes module
*/
function ht_kb_voting_meta_boxes()
{
$prefix = '_ht_voting_';
$voting_metabox = new_cmb2_box(array('id' => $prefix . 'metabox', 'title' => __('Voting Options', 'ht-knowledge-base'), 'object_types' => array('ht_kb'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
//dummy to upgrade fields
$voting_metabox->add_field(array('name' => 'update_dummy', 'id' => $prefix . 'updade_dummy', 'type' => 'title', 'show_on_cb' => array($this, 'maybe_upgrade_meta_fields')));
//voting enable
$voting_metabox->add_field(array('name' => __('Disable Voting', 'ht-knowledge-base'), 'description' => __('Disable voting on this article', 'ht-knowledge-base'), 'id' => $prefix . 'voting_disabled', 'type' => 'checkbox', 'show_on_cb' => array($this, 'cmb_only_show_for_voting_enabled')));
/*
//voting reset - no longer used - see ht-voting-backend instead
$voting_metabox->add_field( array(
'name' => __( 'Reset Voting', 'ht-knowledge-base' ),
'description' => __( 'Check this box to reset all votes for this article on update', 'ht-knowledge-base' ),
'id' => $prefix .'voting_reset',
'type' => 'checkbox',
'default' => false,
'sanitization_cb' => array( $this, 'santize_reset_field' ),
'show_on_cb' => array( $this, 'cmb_only_show_for_votes' ),
) );
*/
//voting reset confirmation
$voting_metabox->add_field(array('name' => __('No Votes', 'ht-knowledge-base'), 'description' => __('There are currently no votes or votes have been reset', 'ht-knowledge-base'), 'id' => $prefix . 'voting_reset_confirm', 'type' => 'checkbox', 'default' => true, 'sanitization_cb' => array($this, 'santize_reset_confirm_field'), 'show_on_cb' => array($this, 'cmb_only_show_for_no_votes')));
//usefulness
$voting_metabox->add_field(array('name' => __('Usefulness', 'ht-knowledge-base'), 'description' => __('Set the usefulness for this article (editing may cause inconsistencies with voting)', 'ht-knowledge-base'), 'id' => '_ht_kb_usefulness', 'type' => 'text'));
}
示例6: anp_meetings_add_proposal_metabox
function anp_meetings_add_proposal_metabox()
{
$cmb = new_cmb2_box(array('id' => 'proposal-detail-page', 'title' => __('Proposal Detail Page', 'meeting'), 'object_types' => array('proposal'), 'context' => 'side', 'priority' => 'high'));
$cmb->add_field(array('name' => __('Status', 'meeting'), 'id' => 'proposal_status', 'type' => 'taxonomy_select', 'taxonomy' => 'proposal_status', 'attributes' => array('required' => 'required')));
$cmb->add_field(array('name' => __('Date Accepted', 'meeting'), 'id' => 'meeting_date', 'type' => 'text_date'));
$cmb->add_field(array('name' => __('Date Effective', 'meeting'), 'id' => 'proposal_date_effective', 'type' => 'text_date'));
}
示例7: cmb2_tb_metaboxes
function cmb2_tb_metaboxes()
{
// Start with an underscore to hide fields from custom fields list
$prefix = 'my_meta_';
/**
* Initiate the metabox
*/
$tb_boxes = new_cmb2_box(array('id' => 'contact_info', 'title' => __('Contact info', 'cmb2'), 'object_types' => array('tablebookings'), 'type' => 'text', 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
// Booking Name
$tb_boxes->add_field(array('name' => __('Contact Name', 'cmb2'), 'desc' => __('Contact Name', 'cmb2'), 'id' => $prefix . 'name', 'type' => 'text'));
// Email text field
$tb_boxes->add_field(array('name' => __('Email', 'cmb2'), 'desc' => __('Email Address', 'cmb2'), 'object_types' => array('tablebookings'), 'id' => $prefix . 'email', 'type' => 'text_email'));
// Booking Phone no.
$tb_boxes->add_field(array('name' => __('Phone', 'cmb2'), 'desc' => __('Phone Number', 'cmb2'), 'id' => $prefix . 'phone', 'type' => 'text'));
$tb_boxes2 = new_cmb2_box(array('id' => 'company_info', 'title' => __('Company info', 'cmb2'), 'object_types' => array('tablebookings'), 'type' => 'text', 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
// Company Name
$tb_boxes2->add_field(array('name' => __('Company Name', 'cmb2'), 'id' => $prefix . 'companyname', 'type' => 'text'));
// Company Address
$tb_boxes2->add_field(array('name' => __('Company Address', 'cmb2'), 'id' => $prefix . 'companyaddress', 'type' => 'text'));
$tb_boxes3 = new_cmb2_box(array('id' => 'Booking_info', 'title' => __('Booking info', 'cmb2'), 'object_types' => array('tablebookings'), 'type' => 'text', 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
// Number of delegates
$tb_boxes3->add_field(array('name' => __('Number of Delegates', 'cmb2'), 'id' => $prefix . 'delenum', 'type' => 'text'));
// Delegate 1 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 1 - First Name', 'cmb2'), 'id' => $prefix . 'd1firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 1 - Second Name', 'cmb2'), 'id' => $prefix . 'd1secondname', 'type' => 'text'));
// Delegate 2 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 2 - First Name', 'cmb2'), 'id' => $prefix . 'd2firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 2 - Second Name', 'cmb2'), 'id' => $prefix . 'd2secondname', 'type' => 'text'));
// Delegate 3 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 3 - First Name', 'cmb2'), 'id' => $prefix . 'd3firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 3 - Second Name', 'cmb2'), 'id' => $prefix . 'd3secondname', 'type' => 'text'));
// Delegate 4 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 4 - First Name', 'cmb2'), 'id' => $prefix . 'd4firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 4 - Second Name', 'cmb2'), 'id' => $prefix . 'd4secondname', 'type' => 'text'));
// Delegate 5 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 5 - First Name', 'cmb2'), 'id' => $prefix . 'd5firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 5 - Second Name', 'cmb2'), 'id' => $prefix . 'd5secondname', 'type' => 'text'));
// Delegate 6 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 6 - First Name', 'cmb2'), 'id' => $prefix . 'd6firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 6 - Second Name', 'cmb2'), 'id' => $prefix . 'd6secondname', 'type' => 'text'));
// Delegate 7 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 7 - First Name', 'cmb2'), 'id' => $prefix . 'd7firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 7 - Second Name', 'cmb2'), 'id' => $prefix . 'd7secondname', 'type' => 'text'));
// Delegate 8 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 8 - First Name', 'cmb2'), 'id' => $prefix . 'd8firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 8 - Second Name', 'cmb2'), 'id' => $prefix . 'd8secondname', 'type' => 'text'));
// Delegate 9 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 9 - First Name', 'cmb2'), 'id' => $prefix . 'd9firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 9 - Second Name', 'cmb2'), 'id' => $prefix . 'd9secondname', 'type' => 'text'));
// Delegate 10 first and last names
$tb_boxes3->add_field(array('name' => __('Delegate 10 - First Name', 'cmb2'), 'id' => $prefix . 'd10firstname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Delegate 10 - Second Name', 'cmb2'), 'id' => $prefix . 'd10secondname', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Total cost', 'cmb2'), 'id' => $prefix . 'total_cost', 'type' => 'text'));
$tb_boxes3->add_field(array('name' => __('Paid', 'cmb2'), 'id' => $prefix . 'paid', 'type' => 'checkbox', 'default' => false));
$tb_boxes3->add_field(array('name' => __('Order ID', 'cmb2'), 'id' => $prefix . 'order_id', 'type' => 'text'));
// Order info
$tb_boxes4 = new_cmb2_box(array('id' => 'order_info', 'title' => __('Order info', 'cmb2'), 'object_types' => array('tablebookings'), 'show_on' => array('key' => 'id', 'value' => ''), 'type' => 'text', 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
$tb_boxes4->add_field(array('name' => __('Password', 'cmb2'), 'id' => $prefix . 'password', 'type' => 'text'));
$tb_boxes4->add_field(array('name' => __('Response', 'cmb2'), 'id' => $prefix . 'response', 'type' => 'text'));
}
示例8: trientamedik_register_product_metabox
function trientamedik_register_product_metabox()
{
$prefix = '_trientamedik_';
$cmb_product = new_cmb2_box(array('id' => $prefix . 'product', 'title' => __('Slide Details', 'trientamedik'), 'object_types' => array('product')));
$cmb_product->add_field(array('name' => __('Main Image', 'trientamedik'), 'desc' => __('Upload an image or enter a URL.', 'trientamedik'), 'id' => $prefix . 'product_image', 'type' => 'file'));
$cmb_product->add_field(array('name' => 'Project Image', 'desc' => '', 'id' => $prefix . 'product_image_list', 'type' => 'file_list'));
}
示例9: skillMetaBox
function skillMetaBox()
{
global $cmb_skill;
$cmb_skill_fields = new_cmb2_box(array('id' => $cmb_skill . 'meta', 'title' => __('Skill Information', 'cmb2'), 'object_types' => array('skill'), 'show_names' => true));
$cmb_skill_fields->add_field(array('name' => __('Skill Percentage', 'cmb2'), 'id' => $cmb_skill . 'meta_percentage', 'type' => 'text_small', 'attributes' => array('type' => 'number', 'min' => 1, 'max' => 100), 'after_field' => '%', 'default' => '1'));
$cmb_skill_fields->add_field(array('name' => __('Skill Percentage Color', 'cmb2'), 'id' => $cmb_skill . 'meta_percentage_color', 'type' => 'colorpicker', 'default' => '#6277b2'));
}
示例10: jpak_project_metaboxes
function jpak_project_metaboxes()
{
$prefix = '_jpak_project_';
// Project Details Box
$cmb = new_cmb2_box(array('id' => 'project_details', 'title' => __('Project Details', 'cmb2'), 'object_types' => array('jpak_project'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
// Project Subtitle
$cmb->add_field(array('name' => 'Subtitle', 'desc' => 'Displays on archive page entry hover. Ex: "Custom Genesis Child Theme"', 'id' => $prefix . 'subtitle', 'type' => 'text'));
// Color Picker
$cmb->add_field(array('name' => 'Project Color', 'desc' => __('Used in page background and button accent.', 'cmb2'), 'id' => $prefix . 'color', 'type' => 'colorpicker', 'default' => '#ffffff'));
// Full Image
$cmb->add_field(array('name' => 'Full Image', 'desc' => 'Recommended Width: 1200px', 'id' => $prefix . 'full_image', 'type' => 'file', 'options' => array('url' => false, 'add_upload_file_text' => 'Upload Image')));
// Desktop Preview
$cmb->add_field(array('name' => 'Desktop Preview Image', 'desc' => 'Recommended Size: 1100px x 700px.', 'id' => $prefix . 'desktop_preview', 'type' => 'file', 'options' => array('url' => false, 'add_upload_file_text' => 'Upload Image')));
// Mobile Preview
$cmb->add_field(array('name' => 'Mobile Preview Image', 'desc' => 'Recommended Size: 400px x 650px.', 'id' => $prefix . 'mobile_preview', 'type' => 'file', 'options' => array('url' => false, 'add_upload_file_text' => 'Upload Image')));
// Features
$cmb->add_field(array('name' => __('Features', 'cmb2'), 'id' => $prefix . 'features', 'type' => 'text', 'repeatable' => true));
// Live URL
$cmb->add_field(array('name' => __('Live Site URL', 'cmb2'), 'desc' => __('For button if project type is "Website".', 'cmb2'), 'id' => $prefix . 'live_url', 'type' => 'text_url', 'protocols' => array('http', 'https')));
// Testimonial
$cmb->add_field(array('name' => 'Testimonial', 'desc' => 'Do not add quotation marks.', 'id' => $prefix . 'testimonial', 'type' => 'textarea_small'));
// Testimonial Name
$cmb->add_field(array('name' => 'Testimonial Name', 'desc' => 'Ex: "Jimbo Fisher"', 'id' => $prefix . 'testimonial_name', 'type' => 'text'));
// Testimonial Occupation
$cmb->add_field(array('name' => 'Testimonial Occupation', 'desc' => 'Ex: "Head Football Coach, USF"', 'id' => $prefix . 'testimonial_occupation', 'type' => 'text'));
}
示例11: cmb2_magicsuggest_metaboxes_example
/**
* Define the metabox and field configurations.
*
* @param array $meta_boxes
* @return array
*/
function cmb2_magicsuggest_metaboxes_example()
{
$prefix = '_cmb2_magicsuggest_demo_';
$example_meta = new_cmb2_box(array('id' => $prefix . 'metabox', 'title' => __('cmb2-magicsuggest-field demo', 'cmb2'), 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
$example_meta->add_field(array('name' => __('Grab some fruits', 'cmb2'), 'desc' => __('Enter up to 6 fruits.', 'cmb2'), 'id' => $prefix . 'fruits', 'type' => 'magicsuggest', 'options' => array('data' => array('Banana', 'Apple', 'Orange', 'Lemon', 'Kiwi'), 'allow_free_entries' => true, 'max_selection' => 6), 'attributes' => array('placeholder' => 'Add or grab some fruit here')));
$example_meta->add_field(array('name' => __('Related Posts', 'cmb2'), 'desc' => __('Add related posts', 'cmb2'), 'id' => $prefix . 'related_posts', 'type' => 'magicsuggest', 'options' => array('data' => get_some_posts_data(), 'expand_on_focus' => true, 'allow_free_entries' => false, 'value_field' => 'post_id', 'display_field' => 'post_title'), 'attributes' => array('placeholder' => 'Enter a related post title here..')));
}
示例12: mbdb_book_grid_meta_boxes
function mbdb_book_grid_meta_boxes()
{
$mbdb_book_grid_metabox = new_cmb2_box(array('id' => 'mbdb_book_grid_metabox', 'title' => __('Book Grid Settings', 'mooberry-book-manager'), 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'default', 'show_names' => true));
$mbdb_book_grid_metabox->add_field(array('name' => __('Display Books on This Page?', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_display', 'type' => 'select', 'default' => 'no', 'options' => array('yes' => __('Yes', 'mooberry-book-manager'), 'no' => __('No', 'mooberry-book-manager'))));
$mbdb_book_grid_metabox->add_field(array('name' => __('Books to Display', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_books', 'type' => 'select', 'options' => mbdb_book_grid_selection_options()));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Books', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_custom', 'type' => 'multicheck', 'options' => mbdb_get_book_array()));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Genres', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_genre', 'type' => 'multicheck', 'options' => mbdb_get_term_options('mbdb_genre')));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Series', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_series', 'type' => 'multicheck', 'options' => mbdb_get_term_options('mbdb_series')));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Tags', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_tag', 'type' => 'multicheck', 'options' => mbdb_get_term_options('mbdb_tag')));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Publishers', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_publisher', 'type' => 'multicheck', 'options' => mbdb_get_publishers('no')));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Editors', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_editor', 'type' => 'multicheck', 'options' => mbdb_get_term_options('mbdb_editor')));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Illustrators', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_illustrator', 'type' => 'multicheck', 'options' => mbdb_get_term_options('mbdb_illustrator')));
$mbdb_book_grid_metabox->add_field(array('name' => __('Select Cover Artists', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_cover_artist', 'type' => 'multicheck', 'options' => mbdb_get_term_options('mbdb_cover_artist')));
$group_by_options = mbdb_book_grid_group_by_options();
$count = count($group_by_options);
for ($x = 1; $x < $count; $x++) {
$mbdb_book_grid_metabox->add_field(array('name' => __('Group Books By', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_group_by_level_' . $x, 'type' => 'select', 'options' => $group_by_options));
// put a warning at the 5th level
if ($x == 5) {
$mbdb_book_grid_metabox->add_field(array('name' => __('Warning: Setting more than 5 levels could cause the page to timeout and not display.', 'mooberry-book-manager'), 'type' => 'title', 'id' => '_mbdb_book_grid_warning', 'attributes' => array('display' => 'none')));
}
}
$mbdb_book_grid_metabox->add_field(array('name' => __('Order By', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_order', 'type' => 'select', 'options' => mbdb_book_grid_order_options()));
$mbdb_book_grid_metabox->add_field(array('name' => __('Use default cover height?', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_cover_height_default', 'type' => 'select', 'default' => 'yes', 'options' => array('yes' => __('Yes', 'mooberry-book-manager'), 'no' => __('No', 'mooberry-book-manager'))));
$mbdb_book_grid_metabox->add_field(array('name' => __('Book Cover Height (px)', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_cover_height', 'type' => 'text_small', 'attributes' => array('type' => 'number', 'pattern' => '\\d*', 'min' => 50)));
$mbdb_book_grid_metabox->add_field(array('name' => __('Additional Content (bottom)', 'mooberry-book-manager'), 'id' => '_mbdb_book_grid_description_bottom', 'type' => 'wysiwyg', 'description' => __('This displays under the book grid.', 'mooberry-book-manager'), 'options' => array('wpautop' => true, 'media_buttons' => true, 'textarea_rows' => 10, 'tabindex' => '', 'editor_css' => '', 'editor_class' => '', 'teeny' => false, 'dfw' => false, 'tinymce' => true, 'quicktags' => true)));
$mbdb_book_grid_metabox = apply_filters('mbdb_book_grid_meta_boxes', $mbdb_book_grid_metabox);
}
示例13: add_fields
/**
* Add the options metabox to the array of metaboxes
* @since 0.1.0
*/
public static function add_fields()
{
// hook in our save notices
$container = new_cmb2_box(array('id' => 'vsi_fields_products', 'title' => 'Informações VSI Gestão', 'object_types' => array('product'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
// Set our CMB2 field
$container->add_field(array('name' => __('ID de Produtos ', 'vinhasoft'), 'desc' => __('ID dos Produtos na base do VSI Gestão', 'vinhasoft'), 'id' => 'vsigestao_product_id', 'type' => 'text', 'default' => '', 'attributes' => array('required' => 'required', 'readonly' => 'readonly')));
}
示例14: myxon_register_service_metabox
function myxon_register_service_metabox()
{
$prefix = '_myxon_';
$cmb_service = new_cmb2_box(array('id' => $prefix . 'service', 'title' => __('Service Details', 'myxon'), 'object_types' => array('service')));
$cmb_service->add_field(array('name' => __('Main Image', 'myxon'), 'desc' => __('Upload an image or enter a URL.', 'myxon'), 'id' => $prefix . 'service_image', 'type' => 'file'));
$cmb_service->add_field(array('name' => 'Project Image', 'desc' => '', 'id' => $prefix . 'service_image_list', 'type' => 'file_list'));
}
示例15: page_mb
function page_mb($meta_boxes)
{
$prefix = "_WW_";
$page_options = new_cmb2_box(array('id' => 'page_options', 'title' => 'Page Options', 'object_types' => array('page'), 'context' => 'normal', 'priority' => 'high', 'show_names' => true));
$page_options->add_field(array('id' => $prefix . 'header_class', 'name' => 'Page header class', 'description' => 'Add any clases you would like added to the .page_header here.', 'type' => 'text'));
$page_options->add_field(array('id' => $prefix . 'content_class', 'name' => 'Content class', 'description' => 'Add any clases you would like added to the .entry-content here.', 'type' => 'text'));
}