Created
October 5, 2018 20:33
-
-
Save Rayhanuc/704d51dddcdfcaa5aaca3b18252c74e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require get_template_directory() . '/inc/cs-framework/cs-framework.php'; | |
function industry_rayhan_theme_metabox ($options) { | |
$options = array(); // remove old options | |
$options [] = array( | |
'id' => 'industry_rayhan_slide_meta', | |
'title' => 'Slide options', | |
'post_type' => 'industry-slide', | |
'context' => 'normal', | |
'priority' => 'default', | |
'sections' => array( | |
array( | |
'name' => 'industry_rayhan_slide_metabox', | |
'icon' => 'fa fa-star', | |
'fields'=> array( | |
array( | |
'id' => 'text_color', | |
'type' => 'color_picker', | |
'default' => '#333', | |
'title' => 'Slide text color', | |
), | |
array( | |
'id' => 'enable_overly', | |
'type' => 'switcher', | |
'title' => 'Enable overlay', | |
'default' => false, | |
), | |
array( | |
'id' => 'overly_opacity', | |
'type' => 'number', | |
'title' => 'Overlay opacity', | |
'desc' => 'Type a number for overlay opacity 1-100. Number only', | |
'default' => '70', | |
'dependency' => array( 'enable_overly', '==', 'true' ), | |
), | |
), | |
), | |
), | |
); | |
//page metabox start | |
$options [] = array( | |
'id' => 'industry_rayhan_slide_page_meta', | |
'title' => 'Page options', | |
'post_type' => 'page', | |
'context' => 'normal', | |
'priority' => 'default', | |
'sections' => array( | |
array( | |
'name' => 'industry_rayhan_page_metabox', | |
'icon' => 'fa fa-star', | |
'fields'=> array( | |
array( | |
'id' => 'text_color', | |
'type' => 'color_picker', | |
'default' => '#333', | |
'title' => 'Slide text color', | |
), | |
array( | |
'id' => 'enable_overly', | |
'type' => 'switcher', | |
'title' => 'Enable overlay', | |
'default' => false, | |
), | |
array( | |
'id' => 'overly_opacity', | |
'type' => 'number', | |
'title' => 'Overlay opacity', | |
'desc' => 'Type a number for overlay opacity 1-100. Number only', | |
'default' => '70', | |
'dependency' => array( 'enable_overly', '==', 'true' ), | |
), | |
), | |
), | |
), | |
);//page metabox end | |
return $options; | |
} | |
add_filter('cs_metabox_options', 'industry_rayhan_theme_metabox'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment