Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action('cmb2_admin_init',function(){
- //post page
- $kta = new_cmb2_box(array(
- 'title' =>'Video',
- 'id' =>'ktavideo',
- 'object_types' =>array('post')
- ));
- $kta-> add_field(array(
- 'name' =>'Background image',
- 'id' =>'dflt-bg-img',
- 'type' =>'file',
- 'description' =>'select here'
- ));
- $kta-> add_field(array(
- 'name' =>'Background title',
- 'id' =>'dflt-bg-title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Background subtitle',
- 'id' =>'dflt-bg-sub-title',
- 'type' =>'wysiwyg',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Short Description',
- 'id' =>'blog_short_des',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Video link',
- 'id' =>'video-link',
- 'type' =>'oembed',
- 'description' =>'Put an embed link'
- ));
- //homepage
- //background video
- $kta = new_cmb2_box(array(
- 'title' =>'Background video',
- 'id' =>'bgvideo',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'homepage.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Select a video',
- 'id' =>'hbgvdo',
- 'type' =>'file',
- 'description' =>'select here (Video should be in mp4 format)'
- ));
- $kta-> add_field(array(
- 'name' =>'video title',
- 'id' =>'bvideotitle',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- //welcome note
- $kta = new_cmb2_box(array(
- 'title' =>'Welcome note',
- 'id' =>'hwelcome',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'homepage.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Welcome text',
- 'id' =>'wtxt',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- //feature content
- $kta = new_cmb2_box(array(
- 'title' =>'Feature content',
- 'id' =>'fcontent',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'homepage.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Iframe video',
- 'id' =>'ifrmvdo',
- 'type' =>'oembed',
- 'description' =>'paste your video embed link here'
- ));
- $kta-> add_field(array(
- 'name' =>'First feature service title',
- 'id' =>'ffst',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'First feature service subtitle',
- 'id' =>'ffss',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'First feature service Image',
- 'id' =>'ffsi',
- 'type' =>'file',
- 'description' =>'select here'
- ));
- $kta-> add_field(array(
- 'name' =>'First feature service URL',
- 'id' =>'ffsurl',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Second feature service title',
- 'id' =>'sfst',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Second feature service subtitle',
- 'id' =>'sfss',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Second feature service Image',
- 'id' =>'sfsi',
- 'type' =>'file',
- 'description' =>'select here'
- ));
- $kta-> add_field(array(
- 'name' =>'Second feature service URL',
- 'id' =>'sfsurl',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- //testimonial
- $kta = new_cmb2_box(array(
- 'title' =>'Testimonial subtitle',
- 'id' =>'testsubtitle',
- 'object_types' => array('testimonial' ), // post type
- ));
- $kta-> add_field(array(
- 'name' =>'Subtitle',
- 'id' =>'tesssubss',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- //KTS Slider
- //testimonial
- $kta = new_cmb2_box(array(
- 'title' =>'KTA slider',
- 'id' =>'ktsl',
- 'object_types' => array( 'kta-slider' ), // post type
- ));
- $kta-> add_field(array(
- 'name' =>'Slider title',
- 'id' =>'ktslititle',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Slider subtitle',
- 'id' =>'ktsslsubtitle',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- //Default page
- $kta = new_cmb2_box(array(
- 'title' =>'Background content',
- 'id' =>'dflt_gb_contents',
- 'object_types' => array( 'page' ), // post type
- // 'show_on' => array( 'key' => 'page-template', 'value' => 'page.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Background image',
- 'id' =>'dflt-bg-img',
- 'type' =>'file',
- 'description' =>'select here'
- ));
- $kta-> add_field(array(
- 'name' =>'Background title',
- 'id' =>'dflt-bg-title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Background subtitle',
- 'id' =>'dflt-bg-sub-title',
- 'type' =>'wysiwyg',
- 'description' =>'type here'
- ));
- //About us page
- $kta = new_cmb2_box(array(
- 'title' =>'KTA Tab',
- 'id' =>'kttab',
- 'object_types' => array('kta-tab' ), // post type
- ));
- $kta-> add_field(array(
- 'name' =>'Tab title',
- 'id' =>'ktstabtitle',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Tab content',
- 'id' =>'ktstabcontent',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta = new_cmb2_box(array(
- 'title' =>'Athlete page contents',
- 'id' =>'atlpcntnts',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'athlete.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Text section title',
- 'id' =>'athtxttitle',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Text section subtitle',
- 'id' =>'athtxtsubs',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Youtube video',
- 'id' =>'ath-video',
- 'type' =>'oembed',
- 'description' =>'paste embed link here'
- ));
- $kta-> add_field(array(
- 'name' =>'Gallery',
- 'id' =>'ath-gall',
- 'type' =>'file_list',
- 'description' =>'select images'
- ));
- $kta = new_cmb2_box(array(
- 'title' =>'Stories',
- 'id' =>'ath_stories',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'athlete.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Story Image',
- 'id' =>'ath-story-imgsss',
- 'type' =>'file',
- 'description' =>'select image'
- ));
- $kta-> add_field(array(
- 'name' =>'Story Title',
- 'id' =>'ath-story-title',
- 'type' =>'text',
- 'description' =>'Type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Story content',
- 'id' =>'ath-story-content',
- 'type' =>'textarea',
- 'description' =>'Type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Story link',
- 'id' =>'ath-story-linkss',
- 'type' =>'text_url',
- 'description' =>'paste your link here'
- ));
- //FAQ
- $kta = new_cmb2_box(array(
- 'title' =>'FAQ',
- 'id' =>'kkssfazqq',
- 'object_types' => array( 'kta-faq' ), // post type
- ));
- $kta-> add_field(array(
- 'name' =>'Questions',
- 'id' =>'ktafaqques',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Answer',
- 'id' =>'ktsfaqanswer',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta = new_cmb2_box(array(
- 'title' =>'Leisure page contents',
- 'id' =>'leipcntnts',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'leisure.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Text section title',
- 'id' =>'leisuretxtsectioontitle',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Text section subtitle',
- 'id' =>'leisecsubttittle',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Youtube video',
- 'id' =>'leisure-video',
- 'type' =>'oembed',
- 'description' =>'paste embed link here'
- ));
- $kta-> add_field(array(
- 'name' =>'Gallery',
- 'id' =>'lei-gall',
- 'type' =>'file_list',
- 'description' =>'select images'
- ));
- //leisure stories
- $kta = new_cmb2_box(array(
- 'title' =>'Stories',
- 'id' =>'leisure_main_stories',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'leisure.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Story Image',
- 'id' =>'leisure-story-imgsss',
- 'type' =>'file',
- 'description' =>'select image'
- ));
- $kta-> add_field(array(
- 'name' =>'Story Title',
- 'id' =>'leisure-story-title',
- 'type' =>'text',
- 'description' =>'Type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Story content',
- 'id' =>'leisure-story-content',
- 'type' =>'textarea',
- 'description' =>'Type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Story link',
- 'id' =>'leisure-story-linkss',
- 'type' =>'text_url',
- 'description' =>'paste your link here'
- ));
- //contact page
- $kta = new_cmb2_box(array(
- 'title' =>'Background contents',
- 'id' =>'con_bg_contents',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'contact.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Quick contact text',
- 'id' =>'quick_con_text',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Enrolement text',
- 'id' =>'con_enrolement_text',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta = new_cmb2_box(array(
- 'title' =>'Enrolement tab',
- 'id' =>'con-en-tabs',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'contact.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Actively enroll title',
- 'id' =>'con_actively_title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Actively enroll subtitle',
- 'id' =>'con_actively_subtitle',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Free trial title',
- 'id' =>'con_free_title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Free trial subtitle',
- 'id' =>'con_free_subtitle',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Enrolement 3rd Tab title',
- 'id' =>'con_enrol_extra_title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Enrolement 3rd Tab Content',
- 'id' =>'con_enrol_extra_cont',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- //Register page
- $kta = new_cmb2_box(array(
- 'title' =>'Background contents',
- 'id' =>'reg_bg_contents',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'register.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Quick contact text',
- 'id' =>'quick_reg_text',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Enrolement text',
- 'id' =>'reg_enrolement_text',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta = new_cmb2_box(array(
- 'title' =>'Enrolement tab',
- 'id' =>'reg-en-tabs',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'register.php' ),
- ));
- $kta-> add_field(array(
- 'name' =>'Actively enroll title',
- 'id' =>'reg_actively_title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Actively enroll subtitle',
- 'id' =>'reg_actively_subtitle',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Free trial title',
- 'id' =>'reg_free_title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Free trial subtitle',
- 'id' =>'reg_free_subtitle',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Enrolement 3rd Tab title',
- 'id' =>'reg_enrol_extra_title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta-> add_field(array(
- 'name' =>'Enrolement 3rd Tab Content',
- 'id' =>'reg_enrol_extra_cont',
- 'type' =>'textarea',
- 'description' =>'type here'
- ));
- // Accordion
- $kta = new_cmb2_box(array(
- 'title' => __( 'FAQ List', 'kta' ),
- 'id' => 'reg_kta_accordion_list',
- 'object_types' => array( 'page' ),
- 'show_on' => array( 'key' => 'page-template', 'value' => 'register.php' ),
- ));
- $reg_group_field_id_accordion = $kta->add_field(array(
- 'id' => 'reg_kta_accordion_list_group',
- 'type' => 'group',
- 'options' => array(
- 'group_title' => __( 'FAQ Item #{#}', 'kta' ),
- 'add_button' => __( 'Add Another Item', 'kta' ),
- 'remove_button' => __( 'Remove Item', 'kta' ),
- 'shortable' => true,
- 'closed' => true
- )
- ));
- $kta->add_group_field( $reg_group_field_id_accordion, array(
- 'name' => __( 'FAQ Nav Title', 'kta' ),
- 'type' => 'text',
- 'id' => 'reg_kta_accordion_nav_title'
- ) );
- $kta->add_group_field( $reg_group_field_id_accordion, array(
- 'name' => __( 'FAQ Content', 'kta' ),
- 'type' => 'wysiwyg',
- 'id' => 'reg_kta_accordion_content'
- ) );
- //Gallery post type
- $kta = new_cmb2_box(array(
- 'title' =>'Gallery contents',
- 'id' =>'main-kta-gallery',
- 'object_types' => array( 'page' ), // post type
- 'show_on' => array( 'key' => 'page-template', 'value' => 'gallery.php' ),
- ));
- $group_field_id = $kta->add_field(array(
- 'id' => '_kta_gallery_page_group',
- 'type' => 'group',
- 'options' => array(
- 'group_title' => __( 'Gallery Item #{#}', 'kta' ),
- 'add_button' => __( 'Add Another Item', 'kta' ),
- 'remove_button' => __( 'Remove Item', 'kta' ),
- 'shortable' => true,
- 'closed' => true
- )
- ));
- $kta->add_group_field( $group_field_id, array(
- 'name' =>'Gallery title',
- 'id' =>'gall-img-title',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- $kta->add_group_field( $group_field_id, array(
- 'name' =>'Gallery image',
- 'id' =>'gall-imgage',
- 'type' =>'file',
- 'description' =>'select from here'
- ));
- $kta->add_group_field( $group_field_id, array(
- 'name' =>'Gallery video ID',
- 'id' =>'gall-video',
- 'type' =>'text',
- 'description' =>'paste youtube video ID Only here'
- ));
- $kta->add_group_field( $group_field_id, array(
- 'name' =>'Gallery Category',
- 'id' =>'gall-img-cat',
- 'type' =>'text',
- 'description' =>'type here'
- ));
- // Gallery Slider
- $kta = new_cmb2_box(array(
- 'title' => __( 'Gallery Slider', 'kta' ),
- 'id' => '_kta_gallery_slider',
- 'object_types' => array( 'page' ), // post type
- ));
- $group_field_id = $kta->add_field(array(
- 'id' => '_kta_gallery_slider_group',
- 'type' => 'group',
- 'options' => array(
- 'group_title' => __( 'Gallery Item #{#}', 'kta' ),
- 'add_button' => __( 'Add Another Item', 'kta' ),
- 'remove_button' => __( 'Remove Item', 'kta' ),
- 'shortable' => true,
- 'closed' => true
- )
- ));
- $kta->add_group_field( $group_field_id, array(
- 'name' => __( 'Title', 'kta' ),
- 'type' => 'text',
- 'id' => '_title'
- ) );
- $kta->add_group_field( $group_field_id, array(
- 'name' => __( 'Subtitle', 'kta' ),
- 'type' => 'text',
- 'id' => '_subtitle'
- ) );
- $kta->add_group_field( $group_field_id, array(
- 'name' => __( 'Thumbnail', 'kta' ),
- 'type' => 'file',
- 'id' => '_thumbnail'
- ) );
- $kta->add_group_field( $group_field_id, array(
- 'name' => __( 'Gallery URL', 'kta' ),
- 'type' => 'text',
- 'id' => '_gallery_vid_id'
- ) );
- // Tab
- $kta = new_cmb2_box(array(
- 'title' => __( 'Tab List', 'kta' ),
- 'id' => '_kta_tab_list',
- 'object_types' => array( 'page' ),
- 'show_on' => array( 'key' => 'page-template', 'value' => 'about.php' )
- ));
- $group_field_id_tab = $kta->add_field(array(
- 'id' => '_kta_tab_list_group',
- 'type' => 'group',
- 'options' => array(
- 'group_title' => __( 'Tab Item #{#}', 'kta' ),
- 'add_button' => __( 'Add Another Item', 'kta' ),
- 'remove_button' => __( 'Remove Item', 'kta' ),
- 'shortable' => true,
- 'closed' => true
- )
- ));
- $kta->add_group_field( $group_field_id_tab, array(
- 'name' => __( 'Tab Nav Title', 'kta' ),
- 'type' => 'text',
- 'id' => '_kta_tab_nav_title'
- ) );
- $kta->add_group_field( $group_field_id_tab, array(
- 'name' => __( 'Tab Content', 'kta' ),
- 'type' => 'wysiwyg',
- 'id' => '_kta_tab_content'
- ) );
- // Accordion
- $kta = new_cmb2_box(array(
- 'title' => __( 'Accordion List', 'kta' ),
- 'id' => '_kta_accordion_list',
- 'object_types' => array( 'page' ),
- 'show_on' => array( 'key' => 'page-template', 'value' => array( 'athlete.php', 'leisure.php' ) )
- ));
- $group_field_id_accordion = $kta->add_field(array(
- 'id' => '_kta_accordion_list_group',
- 'type' => 'group',
- 'options' => array(
- 'group_title' => __( 'Accordion Item #{#}', 'kta' ),
- 'add_button' => __( 'Add Another Item', 'kta' ),
- 'remove_button' => __( 'Remove Item', 'kta' ),
- 'shortable' => true,
- 'closed' => true
- )
- ));
- $kta->add_group_field( $group_field_id_accordion, array(
- 'name' => __( 'Accordion Nav Title', 'kta' ),
- 'type' => 'text',
- 'id' => '_kta_accordion_nav_title'
- ) );
- $kta->add_group_field( $group_field_id_accordion, array(
- 'name' => __( 'Accordion Content', 'kta' ),
- 'type' => 'wysiwyg',
- 'id' => '_kta_accordion_content'
- ) );
- // Member Page Metabox
- $kta['service_list_one_metabox'] = array(
- 'id' => 'service_list_one_metabox',
- 'title' => __( 'Service Options 1', 'opm' ),
- 'object_types' => array( 'page' ), // Post type
- 'context' => 'normal',
- 'priority' => 'high',
- 'show_on' => array( 'key' => 'page-template', 'value' => array( 'member.php' ) )
- 'show_names' => true, // Show field names on the left
- 'fields' => array(
- array(
- 'name' => __( 'Service Nav title', 'dgj' ),
- 'id' => 'service_nav_title_one',
- 'type' => 'text'
- ),
- array(
- 'name' => __( 'Service Meta', 'dgj' ),
- 'id' => 'service_meta_one',
- 'type' => 'wysiwyg'
- ),
- array(
- 'id' => 'first_column_service_price_list_one',
- 'type' => 'group',
- // 'repeatable' => false, // use false if you want non-repeatable group
- 'options' => array(
- 'group_title' => __( 'First Column List {#}', 'dgj' ), // since version 1.1.4, {#} gets replaced by row number
- 'add_button' => __( 'Add Another First Column List', 'dgj' ),
- 'remove_button' => __( 'Remove First Column List', 'dgj' ),
- 'sortable' => true, // beta
- 'closed' => true, // true to have the groups closed by default
- ),
- 'fields' => array(
- array(
- 'name' => __( 'Item Title', 'dgj' ),
- 'id' => 'first_column_item_title_one',
- 'type' => 'text'
- ),
- array(
- 'name' => __( 'Item Price', 'dgj' ),
- 'id' => 'first_column_item_price_one',
- 'type' => 'text'
- ),
- )
- ),
- ),
- );
- // Member Page Meta End
- });
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement