Skip to content

Instantly share code, notes, and snippets.

@Galibri
Created October 17, 2017 16:03
Show Gist options
  • Save Galibri/b9817b1653edbbd94eda511191fb5cb7 to your computer and use it in GitHub Desktop.
Save Galibri/b9817b1653edbbd94eda511191fb5cb7 to your computer and use it in GitHub Desktop.
<?php
require get_template_directory() . '/inc/cs-framework/cs-framework.php';
function industry_apbd_theme_options( $options ) {
$options = array(); // remove old options
$options[] = array(
'id' => '_apbd_industry_page_options',
'title' => 'Slide Configuration',
'post_type' => 'industry-slide',
'context' => 'normal',
'priority' => 'default',
'sections' => array(
array(
'name' => 'slider_color',
'title' => 'Slider Color',
'icon' => 'fa fa-cog',
// begin: fields
'fields' => array(
// begin: a field
array(
'id' => 'slider_text_color',
'type' => 'color_picker',
'title' => 'Select Text Color',
'default' => '#333',
),
array(
'id' => 'slider_enable_overlay',
'type' => 'switcher',
'title' => 'Enable Slide Overlay Color',
'default' => false,
),
array(
'id' => 'slider_overlay_color',
'type' => 'color_picker',
'title' => 'Select Overlay Color',
'rgba' => true,
'dependency' => array( 'slider_enable_overlay', '==', true ),
'default' => 'rgba(51,51,51,0.6)',
),
),
),
array(
'name' => 'slider_button',
'title' => 'Slider Button',
'icon' => 'fa fa-tint',
'fields' => array(
array(
'id' => 'slider_button_enable',
'type' => 'switcher',
'title' => 'Enable Slide Button',
'default' => false,
),
array(
'id' => 'slider_button_text',
'type' => 'text',
'title' => 'Button Text',
'dependency' => array( 'slider_button_enable', '==', true ),
'default' => 'Click Here!',
),
array(
'id' => 'slider_button_link',
'type' => 'text',
'title' => 'Button Link',
'dependency' => array( 'slider_button_enable', '==', true ),
'default' => 'https://example.com/',
),
array(
'id' => 'slider_button_bg_color',
'type' => 'color_picker',
'title' => 'Button Background Color',
'dependency' => array( 'slider_button_enable', '==', true ),
'default' => '#000',
),
array(
'id' => 'slider_button_text_color',
'type' => 'color_picker',
'title' => 'Button Text Color',
'dependency' => array( 'slider_button_enable', '==', true ),
'default' => '#fff',
),
),
),
),
);
return $options;
}
add_filter( 'cs_metabox_options', 'industry_apbd_theme_options' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment