Skip to content

Instantly share code, notes, and snippets.

@MjHead
Last active September 28, 2015 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MjHead/3cd90ee56c028578b640 to your computer and use it in GitHub Desktop.
Save MjHead/3cd90ee56c028578b640 to your computer and use it in GitHub Desktop.
<?php
/**
* Include custom options snippet
*/
add_action( 'after_setup_theme', 'themeXXXX_custom_options' );
function themeXXXX_custom_options() {
require_once CHILD_DIR . '/inc/class-cherry-child-custom-options.php';
$options = array(
'child-menu-bg' => array(
'section' => 'navigation-section',
'is-var' => true,
'type' => 'background',
'title' => __('Navigation panel background', 'theme3718' ),
'description' => __( 'Set background for navigation panel. ', 'theme3718' ),
'hint' => array(
'type' => 'text',
'content' => __('Specify background for header navigation panel', 'theme3718' ),
),
'return_data_type' => 'url',
'library_type' => 'image',
'value' => array(
'image' => '',
'color' => '#333333',
'repeat' => 'repeat',
'position' => 'left',
'attachment' => 'fixed',
'clip' => 'padding-box',
'size' => 'cover',
'origin' => 'padding-box',
)
),
'test-reg' => array(
'section' => 'grid-section',
'is-var' => false,
'type' => 'text',
'title' => __('Text input 2', 'cherry'),
'label' => '',
'description' => '',
'hint' => array(
'type' => 'text',
'content' => __('Regular single line text input field.', 'cherry'),
),
'value' => 'value',
'master' => 'checkbox-text-checkbox-2'
),
'colorpicker-demo-test' => array(
'section' => 'page-section',
'is-var' => true,
'type' => 'colorpicker',
'title' => __('Colorpicker', 'cherry'),
'label' => '',
'decsription' => '',
'hint' => array(
'type' => 'text',
'content' => __('Adds a color picker.', 'cherry'),
),
'value' => '#ff0000',
),
'colorpicker-demo-test-2' => array(
'section' => 'page-section',
'is-var' => true,
'type' => 'colorpicker',
'title' => __('Colorpicker 2', 'cherry'),
'label' => '',
'decsription' => '',
'hint' => array(
'type' => 'text',
'content' => __('Adds a color picker.', 'cherry'),
),
'value' => '#ffff00',
),
'colorpicker-demo-test-2' => array(
'section' => 'footer-logo-subsection-2',
'is-var' => true,
'type' => 'colorpicker',
'title' => __('Colorpicker 3', 'cherry'),
'label' => '',
'decsription' => '',
'hint' => array(
'type' => 'text',
'content' => __('Adds a color picker.', 'cherry'),
),
'value' => '#00ffff',
),
);
$sections = array(
'footer-logo-subsection-2' => array(
'name' => __( 'Logo 2', 'cherry' ),
'icon' => 'dashicons dashicons-arrow-right',
'parent' => 'footer-section',
'priority' => 2,
'filter' => 'cherry_footer_logo_2_options_list',
),
);
new Cherry_Child_Custom_Options( $options, $sections );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment