Created
September 8, 2017 09:59
-
-
Save hasanm95/43f86b6cf2b7d42095b511ed775bb8fd to your computer and use it in GitHub Desktop.
Basic Codestar metabox Code
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
function industry_rrfonline_options( $options ) { | |
$options = array(); | |
$options[] = array( | |
"id" => "industry_rrfonline_slide_meta", | |
"post_type" => "industry-slide", | |
'title' => 'Slide Options', | |
'context' => 'normal', | |
'priority' => 'default', | |
'sections' => array( | |
array( | |
"name" => "industry_rrfonline_slide_metabox", | |
"fields" => array( | |
array( | |
'id' => 'text_clr', | |
'type' => 'color_picker', | |
'title' => 'Slide text color', | |
'default' => '#ffbc00', | |
), | |
array( | |
'id' => 'enable_overlay', | |
'type' => 'switcher', | |
'title' => 'Enabled Overlay', | |
'default' => false, | |
), | |
array( | |
'id' => 'overlay_opacity', | |
'type' => 'number', | |
'title' => 'Overlay opacity', | |
'desc' => 'Type a number for overlay opacity 1-100 number only', | |
'default' => "70", | |
'dependency' => array( 'enable_overlay', '==', true), | |
), | |
) | |
) | |
), | |
); | |
return $options; | |
} | |
add_filter( 'cs_metabox_options', 'industry_rrfonline_options' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment