Skip to content

Instantly share code, notes, and snippets.

@mmh4560
Created August 30, 2017 05:53
Show Gist options
  • Save mmh4560/8d6df478fee412662a1251a8bf7bc616 to your computer and use it in GitHub Desktop.
Save mmh4560/8d6df478fee412662a1251a8bf7bc616 to your computer and use it in GitHub Desktop.
Practise codestarframework
<?php
require_once( get_template_directory() . '/inc/cs-framwork/cs-framework.php');
function indst_tm_opt_mtbx($options){
$options = array();
$options[] = array(
'id' => 'indst_tm_slide_meta',
'title' => 'Slider Options',
'post_type' => 'inds-slider',
'context' => 'normal',
'priority' => 'default',
'sections' => array(
array(
'name' => 'indst_tm_sld_mtbx',
'titile' => 'Slide Options',
'fields' => array(
array(
'id' => 'text_color',
'type' => 'color_picker',
'title' => 'Slide Text Color',
'default' => '#333333'
),
array(
'id' => 'enable_overly',
'type' => 'switcher',
'title' => 'Enable Overly',
'default' => 'false'
),
array(
'id' => 'overly_opacity',
'type' => 'number',
'title' => 'Overly Opacity',
'default' => '80',
'dependency'=> array( 'enable_overly', '==', 'true' ),
)
)
)
),
);
$options[] = array(
'id' => 'indst_tm_page_meta',
'title' => 'Page Options',
'post_type' => 'page',
'context' => 'normal',
'priority' => 'default',
'sections' => array(
array(
'name' => 'indst_tm_pg_mtbx',
'titile' => 'Page Options',
'fields' => array(
array(
'id' => 'sidebar',
'type' => 'switcher',
'title' => 'Sidebar Option',
'default' => 'false'
),
array(
'id' => 'show_sidebar',
'type' => 'select',
'title' => 'Choose Sidebar',
'options' => array(
'left' => 'Left Sidebar',
'right' => 'Right Sidebar'
),
'dependency'=> array( 'sidebar', '==', 'true' ),
),
)
)
),
);
return $options;
}
add_filter('cs_metabox_options', 'indst_tm_opt_mtbx');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment