$this->plugin_slug . '_options',
'hookup' => false,
'show_on' => array( 'key' => 'options-page', 'value' => array( $this->plugin_slug ) ),
'show_names' => true,
) );
$cmb->add_field( array(
'name' => __( 'Text', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_text',
'type' => 'text',
'default' => 'Default Text',
) );
$cmb->add_field( array(
'name' => __( 'Color Picker', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_colorpicker',
'type' => 'colorpicker',
'default' => '#bada55',
) );
$cmb->add_field( array(
'name' => __( 'Test Text Medium', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_textmedium',
'type' => 'text_medium',
// 'repeatable' => true,
) );
$cmb->add_field( array(
'name' => __( 'Website URL', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_url',
'type' => 'text_url',
) );
$cmb->add_field( array(
'name' => __( 'Test Text Email', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_email',
'type' => 'text_email',
) );
$cmb->add_field( array(
'name' => __( 'Test Time', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_time',
'type' => 'text_time',
) );
$cmb->add_field( array(
'name' => __( 'Time zone', $this->plugin_slug ),
'desc' => __( 'Time zone', $this->plugin_slug ),
'id' => $this->plugin_slug . '_timezone',
'type' => 'select_timezone',
) );
$cmb->add_field( array(
'name' => __( 'Test Date Picker', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_textdate',
'type' => 'text_date',
) );
$cmb->add_field( array(
'name' => __( 'Test Date Picker (UNIX timestamp)', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_textdate_timestamp',
'type' => 'text_date_timestamp',
) );
$cmb->add_field( array(
'name' => __( 'Test Date/Time Picker Combo (UNIX timestamp)', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_datetime_timestamp',
'type' => 'text_datetime_timestamp',
) );
$cmb->add_field( array(
'name' => __( 'Test Money', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_textmoney',
'type' => 'text_money',
'before_field' => '€', // Override '$' symbol if needed
) );
$cmb->add_field( array(
'name' => __( 'Test Text Area', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_textarea',
'type' => 'textarea',
) );
$cmb->add_field( array(
'name' => __( 'Test Text Area Small', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_textareasmall',
'type' => 'textarea_small',
) );
$cmb->add_field( array(
'name' => __( 'Test Text Area for Code', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_textarea_code',
'type' => 'textarea_code',
) );
$cmb->add_field( array(
'name' => __( 'Test Title Weeeee', $this->plugin_slug ),
'desc' => __( 'This is a title description', $this->plugin_slug ),
'id' => $this->plugin_slug . '_title',
'type' => 'title',
) );
$cmb->add_field( array(
'name' => __( 'Test Select', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_select',
'type' => 'select',
'show_option_none' => true,
'options' => array(
'standard' => __( 'Option One', $this->plugin_slug ),
'custom' => __( 'Option Two', $this->plugin_slug ),
'none' => __( 'Option Three', $this->plugin_slug ),
),
) );
$cmb->add_field( array(
'name' => __( 'Test Radio inline', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_radio_inline',
'type' => 'radio_inline',
'show_option_none' => 'No Selection',
'options' => array(
'standard' => __( 'Option One', $this->plugin_slug ),
'custom' => __( 'Option Two', $this->plugin_slug ),
'none' => __( 'Option Three', $this->plugin_slug ),
),
) );
$cmb->add_field( array(
'name' => __( 'Test Radio', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_radio',
'type' => 'radio',
'options' => array(
'option1' => __( 'Option One', $this->plugin_slug ),
'option2' => __( 'Option Two', $this->plugin_slug ),
'option3' => __( 'Option Three', $this->plugin_slug ),
),
) );
$cmb->add_field( array(
'name' => __( 'Test Taxonomy Radio', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_text_taxonomy_radio',
'type' => 'taxonomy_radio',
'taxonomy' => 'category', // Taxonomy Slug
// 'inline' => true, // Toggles display to inline
) );
$cmb->add_field( array(
'name' => __( 'Test Taxonomy Select', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_taxonomy_select',
'type' => 'taxonomy_select',
'taxonomy' => 'category',// Taxonomy Slug
) );
$cmb->add_field( array(
'name' => __( 'Test Taxonomy Multi Checkbox', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_multitaxonomy',
'type' => 'taxonomy_multicheck',
'taxonomy' => 'category',// Taxonomy Slug
) );
$cmb->add_field( array(
'name' => __( 'Test Checkbox', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
// 'id' => $this->plugin_slug . '_checkbox',
'id' => 'italystrap_settings[lazyload]',
'type' => 'checkbox',
) );
$cmb->add_field( array(
'name' => __( 'Test Multi Checkbox', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_multicheckbox',
'type' => 'multicheck',
'options' => array(
'check1' => __( 'Check One', $this->plugin_slug ),
'check2' => __( 'Check Two', $this->plugin_slug ),
'check3' => __( 'Check Three', $this->plugin_slug ),
),
) );
$cmb->add_field( array(
'name' => __( 'Test wysiwyg', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_wysiwyg',
'type' => 'wysiwyg',
'options' => array( 'textarea_rows' => 5 ),
) );
$cmb->add_field( array(
'name' => __( 'Test Image', $this->plugin_slug ),
'desc' => __( 'Upload an image or enter a URL.', $this->plugin_slug ),
'id' => $this->plugin_slug . '_image',
'type' => 'file',
) );
$cmb->add_field( array(
'name' => __( 'Multiple Files', $this->plugin_slug ),
'desc' => __( 'Upload or add multiple images/attachments.', $this->plugin_slug ),
'id' => $this->plugin_slug . '_file_list',
'type' => 'file_list',
'preview_size' => array( 100, 100 ),// Default: array( 50, 50 )
) );
$cmb->add_field( array(
'name' => __( 'oEmbed', $this->plugin_slug ),
'desc' => __( 'Enter a youtube, twitter, or instagram URL. Supports services listed at
http://codex.wordpress.org/Embeds.', $this->plugin_slug ),
'id' => $this->plugin_slug . '_embed',
'type' => 'oembed',
) );
$cmb->add_field( array(
'name' => 'Testing Field Parameters',
'id' => $this->plugin_slug . '_parameters',
'type' => 'text',
'before_row' => '
before_row_if_2
',// Callback
'before' => '
Testing "before" parameter
',
'before_field' => '
Testing "before_field" parameter
',
'after_field' => '
Testing "after_field" parameter
',
'after' => '
Testing "after" parameter
',
'after_row' => '
Testing "after_row" parameter
',
) );
cmb2_metabox_form( $this->plugin_slug . '_options', $this->plugin_slug . '-settings' );
?>
$this->plugin_slug . '_options-second',
'hookup' => false,
'show_on' => array( 'key' => 'options-page', 'value' => array( $this->plugin_slug ) ),
'show_names' => true,
) );
$cmb->add_field( array(
'name' => __( 'Text', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_text-second',
'type' => 'text',
'default' => 'Default Text',
) );
$cmb->add_field( array(
'name' => __( 'Color Picker', $this->plugin_slug ),
'desc' => __( 'field description (optional)', $this->plugin_slug ),
'id' => $this->plugin_slug . '_colorpicker-second',
'type' => 'colorpicker',
'default' => '#bada55',
) );
cmb2_metabox_form( $this->plugin_slug . '_options-second', $this->plugin_slug . '-settings-second' );
?>