/**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_theme_options = bavotasan_theme_options();
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'ward'), 'priority' => 35));
     $wp_customize->add_setting('ward_theme_options[width]', array('default' => $bavotasan_theme_options['width'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_width', array('label' => __('Site Width', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_theme_options[width]', 'priority' => 10, 'type' => 'select', 'choices' => array('1200' => __('1200px', 'ward'), '992' => __('992px', 'ward'))));
     $wp_customize->add_setting('ward_theme_options[layout]', array('default' => $bavotasan_theme_options['layout'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_site_layout', array('label' => __('Site Layout', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_theme_options[layout]', 'priority' => 15, 'type' => 'radio', 'choices' => array('1' => __('1 Sidebar - Left', 'ward'), '2' => __('1 Sidebar - Right', 'ward'), '6' => __('No Sidebars', 'ward'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%', 'col-md-12' => '100%');
     $wp_customize->add_setting('ward_theme_options[primary]', array('default' => $bavotasan_theme_options['primary'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_primary_column', array('label' => __('Main Content', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_theme_options[primary]', 'priority' => 20, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('ward_theme_options[excerpt_content]', array('default' => $bavotasan_theme_options['excerpt_content'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_excerpt_content', array('label' => __('Post Content Display', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_theme_options[excerpt_content]', 'priority' => 30, 'type' => 'radio', 'choices' => array('excerpt' => __('Teaser Excerpt', 'ward'), 'content' => __('Full Content', 'ward'))));
     // Jumbo headline section panel
     $wp_customize->add_section('bavotasan_jumbo', array('title' => __('Jumbo Headline', 'ward'), 'priority' => 36));
     $wp_customize->add_setting('ward_theme_options[jumbo_headline_title]', array('default' => $bavotasan_theme_options['jumbo_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_title', array('label' => __('Jumbo Headline Title', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_theme_options[jumbo_headline_title]', 'priority' => 26, 'type' => 'text'));
     $wp_customize->add_setting('ward_theme_options[jumbo_headline_text]', array('default' => $bavotasan_theme_options['jumbo_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_text', array('label' => __('Jumbo Headline Text', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_theme_options[jumbo_headline_text]', 'priority' => 27, 'type' => 'text'));
     // Posts panel
     $wp_customize->add_section('bavotasan_posts', array('title' => __('Posts', 'ward'), 'priority' => 45));
     $wp_customize->add_setting('ward_theme_options[display_categories]', array('default' => $bavotasan_theme_options['display_categories'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_categories', array('label' => __('Display Categories', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_theme_options[display_categories]', 'type' => 'checkbox'));
     $wp_customize->add_setting('ward_theme_options[display_author]', array('default' => $bavotasan_theme_options['display_author'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_author', array('label' => __('Display Author', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_theme_options[display_author]', 'type' => 'checkbox'));
     $wp_customize->add_setting('ward_theme_options[display_date]', array('default' => $bavotasan_theme_options['display_date'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_date', array('label' => __('Display Date', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_theme_options[display_date]', 'type' => 'checkbox'));
     $wp_customize->add_setting('ward_theme_options[display_comment_count]', array('default' => $bavotasan_theme_options['display_comment_count'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_comment_count', array('label' => __('Display Comment Count', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_theme_options[display_comment_count]', 'type' => 'checkbox'));
 }
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_default_theme_options = bavotasan_default_theme_options();
     $wp_customize->get_setting('background_color')->transport = 'refresh';
     $wp_customize->get_setting('background_image')->transport = 'refresh';
     $wp_customize->get_setting('background_repeat')->transport = 'refresh';
     $wp_customize->get_setting('background_position_x')->transport = 'refresh';
     $wp_customize->get_setting('background_attachment')->transport = 'refresh';
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'tienda'), 'priority' => 35));
     $wp_customize->add_setting('width', array('default' => $bavotasan_default_theme_options['width'], 'sanitize_callback' => 'absint'));
     $wp_customize->add_control('width', array('label' => __('Site Width', 'tienda'), 'section' => 'bavotasan_layout', 'priority' => 10, 'type' => 'select', 'choices' => array('1170' => __('1200px', 'tienda'), '992' => __('992px', 'tienda'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%');
     $wp_customize->add_setting('primary', array('default' => $bavotasan_default_theme_options['primary'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('primary', array('label' => __('Main Content Width', 'tienda'), 'section' => 'bavotasan_layout', 'priority' => 15, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('layout', array('default' => $bavotasan_default_theme_options['layout'], 'sanitize_callback' => 'esc_attr'));
     $layout_choices = array('left' => __('Left', 'tienda'), 'right' => __('Right', 'tienda'));
     $wp_customize->add_control(new Bavotasan_Post_Layout_Control($wp_customize, 'layout', array('label' => __('Sidebar Layout', 'tienda'), 'section' => 'bavotasan_layout', 'priority' => 25, 'choices' => $layout_choices)));
 }
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_theme_options = bavotasan_theme_options();
     $wp_customize->add_setting('tonic_theme_options[tagline]', array('default' => $bavotasan_theme_options['tagline'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_tagline', array('label' => __('Display Tagline', 'tonic'), 'section' => 'title_tagline', 'settings' => 'tonic_theme_options[tagline]', 'type' => 'checkbox'));
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'tonic'), 'priority' => 35));
     $wp_customize->add_setting('tonic_theme_options[width]', array('default' => $bavotasan_theme_options['width'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_width', array('label' => __('Site Width', 'tonic'), 'section' => 'bavotasan_layout', 'settings' => 'tonic_theme_options[width]', 'priority' => 10, 'type' => 'select', 'choices' => array('' => '1200px', 'w960' => __('960px', 'tonic'))));
     $wp_customize->add_setting('tonic_theme_options[layout]', array('default' => $bavotasan_theme_options['layout'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_site_layout', array('label' => __('Site Layout', 'tonic'), 'section' => 'bavotasan_layout', 'settings' => 'tonic_theme_options[layout]', 'priority' => 15, 'type' => 'radio', 'choices' => array('1' => __('Left Sidebar', 'tonic'), '2' => __('Right Sidebar', 'tonic'), '6' => __('No Sidebar', 'tonic'))));
     $choices = array('c2' => '17%', 'c3' => '25%', 'c4' => '34%', 'c5' => '42%', 'c6' => '50%', 'c7' => '58%', 'c8' => '66%', 'c9' => '75%', 'c10' => '83%', 'c12' => '100%');
     $wp_customize->add_setting('tonic_theme_options[primary]', array('default' => $bavotasan_theme_options['primary'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_primary_column', array('label' => __('Main Content', 'tonic'), 'section' => 'bavotasan_layout', 'settings' => 'tonic_theme_options[primary]', 'priority' => 20, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('tonic_theme_options[excerpt_content]', array('default' => $bavotasan_theme_options['excerpt_content'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_excerpt_content', array('label' => __('Post Content Display', 'tonic'), 'section' => 'bavotasan_layout', 'settings' => 'tonic_theme_options[excerpt_content]', 'priority' => 30, 'type' => 'radio', 'choices' => array('excerpt' => __('Teaser Excerpt', 'tonic'), 'content' => __('Full Content', 'tonic'))));
     $wp_customize->add_setting('tonic_theme_options[home_widget]', array('default' => $bavotasan_theme_options['home_widget'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_home_widget', array('label' => __('Display Home Page Top Widget Area', 'tonic'), 'section' => 'bavotasan_layout', 'settings' => 'tonic_theme_options[home_widget]', 'priority' => 35, 'type' => 'checkbox'));
     $wp_customize->add_setting('tonic_theme_options[home_posts]', array('default' => $bavotasan_theme_options['home_posts'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_home_posts', array('label' => __('Display Home Page Posts & Sidebar', 'tonic'), 'section' => 'bavotasan_layout', 'settings' => 'tonic_theme_options[home_posts]', 'priority' => 40, 'type' => 'checkbox'));
     // Jumbotron
     $wp_customize->add_section('bavotasan_jumbo', array('title' => __('Jumbo Headline', 'tonic'), 'priority' => 36));
     $wp_customize->add_setting('tonic_theme_options[jumbo_headline_title]', array('default' => $bavotasan_theme_options['jumbo_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_title', array('label' => __('Title', 'tonic'), 'section' => 'bavotasan_jumbo', 'settings' => 'tonic_theme_options[jumbo_headline_title]', 'priority' => 26, 'type' => 'text'));
     $wp_customize->add_setting('tonic_theme_options[jumbo_headline_text]', array('default' => $bavotasan_theme_options['jumbo_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_text', array('label' => __('Text', 'tonic'), 'section' => 'bavotasan_jumbo', 'settings' => 'tonic_theme_options[jumbo_headline_text]', 'priority' => 27, 'type' => 'text'));
     $wp_customize->add_setting('tonic_theme_options[jumbo_headline_button_text]', array('default' => $bavotasan_theme_options['jumbo_headline_button_text'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_button_text', array('label' => __('Button Text', 'tonic'), 'section' => 'bavotasan_jumbo', 'settings' => 'tonic_theme_options[jumbo_headline_button_text]', 'priority' => 28, 'type' => 'text'));
     $wp_customize->add_setting('tonic_theme_options[jumbo_headline_button_link]', array('default' => $bavotasan_theme_options['jumbo_headline_button_link'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_button_link', array('label' => __('Button Link', 'tonic'), 'section' => 'bavotasan_jumbo', 'settings' => 'tonic_theme_options[jumbo_headline_button_link]', 'priority' => 29, 'type' => 'text'));
     // Posts panel
     $wp_customize->add_section('bavotasan_posts', array('title' => __('Posts', 'tonic'), 'priority' => 45));
     $wp_customize->add_setting('tonic_theme_options[display_categories]', array('default' => $bavotasan_theme_options['display_categories'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_categories', array('label' => __('Display Categories', 'tonic'), 'section' => 'bavotasan_posts', 'settings' => 'tonic_theme_options[display_categories]', 'type' => 'checkbox'));
     $wp_customize->add_setting('tonic_theme_options[display_author]', array('default' => $bavotasan_theme_options['display_author'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_author', array('label' => __('Display Author', 'tonic'), 'section' => 'bavotasan_posts', 'settings' => 'tonic_theme_options[display_author]', 'type' => 'checkbox'));
     $wp_customize->add_setting('tonic_theme_options[display_date]', array('default' => $bavotasan_theme_options['display_date'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_date', array('label' => __('Display Date', 'tonic'), 'section' => 'bavotasan_posts', 'settings' => 'tonic_theme_options[display_date]', 'type' => 'checkbox'));
     $wp_customize->add_setting('tonic_theme_options[display_comment_count]', array('default' => $bavotasan_theme_options['display_comment_count'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_comment_count', array('label' => __('Display Comment Count', 'tonic'), 'section' => 'bavotasan_posts', 'settings' => 'tonic_theme_options[display_comment_count]', 'type' => 'checkbox'));
 }
Beispiel #4
0
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_default_theme_options = bavotasan_theme_options();
     $wp_customize->add_setting('arc', array('default' => $bavotasan_default_theme_options['arc'], 'sanitize_callback' => 'absint'));
     $wp_customize->add_control(new Bavotasan_Text_Description_Control($wp_customize, 'arc', array('label' => __('Arc Radius', 'arcade-basic'), 'section' => 'title_tagline', 'priority' => 10)));
     $wp_customize->add_setting('arc_inner', array('default' => $bavotasan_default_theme_options['arc_inner'], 'sanitize_callback' => 'absint'));
     $wp_customize->add_control(new Bavotasan_Text_Description_Control($wp_customize, 'arc_inner', array('label' => __('Arc Radius (Inner Pages)', 'arcade-basic'), 'section' => 'title_tagline', 'description' => __('The space and rotation for each letter will be calculated using the arc radius and the width of the site title. Leave blank for no arc.', 'arcade-basic'), 'priority' => 20)));
     $wp_customize->add_setting('fittext', array('default' => $bavotasan_default_theme_options['fittext'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('fittext', array('label' => __('Use Fittext for long site title', 'arcade-basic'), 'section' => 'title_tagline', 'type' => 'checkbox', 'priority' => 30));
     $wp_customize->add_setting('header_icon', array('default' => $bavotasan_default_theme_options['header_icon'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control(new Bavotasan_Icon_Select_Control($wp_customize, 'header_icon', array('label' => __('Header Icon', 'arcade-basic'), 'section' => 'title_tagline', 'priority' => 40)));
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'arcade-basic'), 'priority' => 35));
     $wp_customize->add_setting('width', array('default' => $bavotasan_default_theme_options['width'], 'sanitize_callback' => 'absint'));
     $wp_customize->add_control('width', array('label' => __('Site Width', 'arcade-basic'), 'section' => 'bavotasan_layout', 'priority' => 10, 'type' => 'select', 'choices' => array('1170' => __('1200px', 'arcade-basic'), '992' => __('992px', 'arcade-basic'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%');
     $wp_customize->add_setting('primary', array('default' => $bavotasan_default_theme_options['primary'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('primary', array('label' => __('Main Content Width', 'arcade-basic'), 'section' => 'bavotasan_layout', 'priority' => 15, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('layout', array('default' => $bavotasan_default_theme_options['layout'], 'sanitize_callback' => 'esc_attr'));
     $layout_choices = array('left' => __('Left', 'arcade-basic'), 'right' => __('Right', 'arcade-basic'));
     $wp_customize->add_control(new Bavotasan_Post_Layout_Control($wp_customize, 'layout', array('label' => __('Sidebar Layout', 'arcade-basic'), 'section' => 'bavotasan_layout', 'size' => false, 'priority' => 25, 'choices' => $layout_choices)));
     $colors = array('default' => __('Default', 'arcade-basic'), 'info' => __('Light Blue', 'arcade-basic'), 'primary' => __('Blue', 'arcade-basic'), 'danger' => __('Red', 'arcade-basic'), 'warning' => __('Yellow', 'arcade-basic'), 'success' => __('Green', 'arcade-basic'));
     // Posts panel
     $wp_customize->add_section('bavotasan_posts', array('title' => __('Posts', 'arcade-basic'), 'priority' => 45, 'description' => __('These options do not affect the Post Block page template.', 'arcade-basic')));
     $wp_customize->add_setting('display_author', array('default' => $bavotasan_default_theme_options['display_author'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_author', array('label' => __('Display Author', 'arcade-basic'), 'section' => 'bavotasan_posts', 'type' => 'checkbox', 'priority' => 10));
     $wp_customize->add_setting('display_date', array('default' => $bavotasan_default_theme_options['display_date'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_date', array('label' => __('Display Date', 'arcade-basic'), 'section' => 'bavotasan_posts', 'type' => 'checkbox', 'priority' => 20));
     $wp_customize->add_setting('display_categories', array('default' => $bavotasan_default_theme_options['display_categories'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_categories', array('label' => __('Display Categories', 'arcade-basic'), 'section' => 'bavotasan_posts', 'type' => 'checkbox', 'priority' => 30));
     $wp_customize->add_setting('display_comment_count', array('default' => $bavotasan_default_theme_options['display_comment_count'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_comment_count', array('label' => __('Display Comment Count', 'arcade-basic'), 'section' => 'bavotasan_posts', 'type' => 'checkbox', 'priority' => 40));
 }
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_theme_options = bavotasan_theme_options();
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'ward'), 'priority' => 35));
     $wp_customize->add_setting('ward_pro_theme_options[boxed]', array('default' => $bavotasan_theme_options['boxed'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_boxed', array('label' => __('Boxed', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[boxed]', 'type' => 'checkbox', 'priority' => 5));
     $wp_customize->add_setting('ward_pro_theme_options[width]', array('default' => $bavotasan_theme_options['width'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_width', array('label' => __('Site Width', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[width]', 'priority' => 10, 'type' => 'select', 'choices' => array('1200' => __('1200px', 'ward'), '992' => __('992px', 'ward'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%');
     $wp_customize->add_setting('ward_pro_theme_options[primary]', array('default' => $bavotasan_theme_options['primary'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_primary_column', array('label' => __('Main Content', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[primary]', 'priority' => 15, 'type' => 'select', 'choices' => $choices));
     if (is_active_sidebar('second-sidebar')) {
         $wp_customize->add_setting('ward_pro_theme_options[secondary]', array('default' => $bavotasan_theme_options['secondary'], 'type' => 'option', 'capability' => 'edit_theme_options'));
         $wp_customize->add_control('bavotasan_secondary_column', array('label' => __('First Sidebar', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[secondary]', 'priority' => 20, 'type' => 'select', 'choices' => $choices));
     }
     $wp_customize->add_setting('ward_pro_theme_options[layout]', array('default' => $bavotasan_theme_options['layout'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $layout_choices = array('left' => __('Left', 'ward'), 'right' => __('Right', 'ward'));
     if (is_active_sidebar('second-sidebar')) {
         $layout_choices['separate'] = __('Separate', 'ward');
     }
     $wp_customize->add_control(new Bavotasan_Post_Layout_Control($wp_customize, 'layout', array('label' => __('Sidebar Layout', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[layout]', 'size' => false, 'priority' => 25, 'choices' => $layout_choices)));
     $wp_customize->add_setting('ward_pro_theme_options[excerpt_content]', array('default' => $bavotasan_theme_options['excerpt_content'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_excerpt_content', array('label' => __('Post Content Display', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[excerpt_content]', 'priority' => 30, 'type' => 'radio', 'choices' => array('excerpt' => __('Teaser Excerpt', 'ward'), 'content' => __('Full Content', 'ward'))));
     $wp_customize->add_setting('ward_pro_theme_options[read_more]', array('default' => $bavotasan_theme_options['read_more'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_read_more', array('label' => __('"Read More" Text', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[read_more]', 'priority' => 33, 'type' => 'text'));
     $colors = array('info' => __('Light Blue', 'ward'), 'primary' => __('Blue', 'ward'), 'danger' => __('Red', 'ward'), 'warning' => __('Yellow', 'ward'), 'success' => __('Green', 'ward'));
     $wp_customize->add_setting('ward_pro_theme_options[read_more_color]', array('default' => $bavotasan_theme_options['read_more_color'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_read_more_color', array('label' => __('Read More Color', 'ward'), 'section' => 'bavotasan_layout', 'settings' => 'ward_pro_theme_options[read_more_color]', 'priority' => 34, 'type' => 'select', 'choices' => $colors));
     // Jumbo headline section panel
     $wp_customize->add_section('bavotasan_jumbo', array('title' => __('Jumbo Headline', 'ward'), 'priority' => 36));
     $wp_customize->add_setting('ward_pro_theme_options[jumbo_headline_title]', array('default' => $bavotasan_theme_options['jumbo_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_title', array('label' => __('Title', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_pro_theme_options[jumbo_headline_title]', 'priority' => 26, 'type' => 'text'));
     $wp_customize->add_setting('ward_pro_theme_options[jumbo_headline_text]', array('default' => $bavotasan_theme_options['jumbo_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_text', array('label' => __('Text', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_pro_theme_options[jumbo_headline_text]', 'priority' => 27, 'type' => 'text'));
     $wp_customize->add_setting('ward_pro_theme_options[jumbo_headline_button_text]', array('default' => $bavotasan_theme_options['jumbo_headline_button_text'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_button_text', array('label' => __('Button Text', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_pro_theme_options[jumbo_headline_button_text]', 'priority' => 28, 'type' => 'text'));
     $wp_customize->add_setting('ward_pro_theme_options[jumbo_headline_button_link]', array('default' => $bavotasan_theme_options['jumbo_headline_button_link'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_button_link', array('label' => __('Button Link', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_pro_theme_options[jumbo_headline_button_link]', 'priority' => 29, 'type' => 'text'));
     $wp_customize->add_setting('ward_pro_theme_options[jumbo_headline_button_color]', array('default' => $bavotasan_theme_options['jumbo_headline_button_color'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_jumbo_headline_button_color', array('label' => __('Button Color', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_pro_theme_options[jumbo_headline_button_color]', 'priority' => 30, 'type' => 'select', 'choices' => $colors));
     $wp_customize->add_setting('ward_pro_theme_options[widget_area_icon]', array('default' => $bavotasan_theme_options['widget_area_icon'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control(new Bavotasan_Icon_Select_Control($wp_customize, 'widget_area_icon', array('label' => __('Icon', 'ward'), 'section' => 'bavotasan_jumbo', 'settings' => 'ward_pro_theme_options[widget_area_icon]', 'priority' => 35)));
     // Fonts panel
     $mixed_fonts = array_merge(bavotasan_websafe_fonts(), bavotasan_google_fonts());
     asort($mixed_fonts);
     $wp_customize->add_section('bavotasan_fonts', array('title' => __('Fonts', 'ward'), 'priority' => 40));
     $wp_customize->add_setting('ward_pro_theme_options[main_text_font]', array('default' => $bavotasan_theme_options['main_text_font'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_main_text_font', array('label' => __('Main Text', 'ward'), 'section' => 'bavotasan_fonts', 'settings' => 'ward_pro_theme_options[main_text_font]', 'priority' => 10, 'type' => 'select', 'choices' => $mixed_fonts));
     $wp_customize->add_setting('ward_pro_theme_options[headers_font]', array('default' => $bavotasan_theme_options['headers_font'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_headers_font', array('label' => __('Headers (h1, h2, h3, etc...)', 'ward'), 'section' => 'bavotasan_fonts', 'settings' => 'ward_pro_theme_options[headers_font]', 'priority' => 15, 'type' => 'select', 'choices' => $mixed_fonts));
     $wp_customize->add_setting('ward_pro_theme_options[post_title_font]', array('default' => $bavotasan_theme_options['post_title_font'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_post_title_font', array('label' => __('Post Title', 'ward'), 'section' => 'bavotasan_fonts', 'settings' => 'ward_pro_theme_options[post_title_font]', 'priority' => 30, 'type' => 'select', 'choices' => $mixed_fonts));
     $wp_customize->add_setting('ward_pro_theme_options[post_meta_font]', array('default' => $bavotasan_theme_options['post_meta_font'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_meta_font', array('label' => __('Post Meta', 'ward'), 'section' => 'bavotasan_fonts', 'settings' => 'ward_pro_theme_options[post_meta_font]', 'priority' => 35, 'type' => 'select', 'choices' => $mixed_fonts));
     $wp_customize->add_setting('ward_pro_theme_options[post_category_font]', array('default' => $bavotasan_theme_options['post_category_font'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_post_category_font', array('label' => __('Post Category', 'ward'), 'section' => 'bavotasan_fonts', 'settings' => 'ward_pro_theme_options[post_category_font]', 'priority' => 40, 'type' => 'select', 'choices' => $mixed_fonts));
     // Color panel
     $wp_customize->add_setting('ward_pro_theme_options[headers_color]', array('default' => $bavotasan_theme_options['headers_color'], 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'headers_color', array('label' => __('Headers (h1, h2, h3, etc...)', 'ward'), 'section' => 'colors', 'settings' => 'ward_pro_theme_options[headers_color]', 'priority' => 20)));
     $wp_customize->add_setting('ward_pro_theme_options[main_text_color]', array('default' => $bavotasan_theme_options['main_text_color'], 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'main_text_color', array('label' => __('Main Text Color', 'ward'), 'section' => 'colors', 'settings' => 'ward_pro_theme_options[main_text_color]', 'priority' => 25)));
     $wp_customize->add_setting('ward_pro_theme_options[link_color]', array('default' => $bavotasan_theme_options['link_color'], 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'link_color', array('label' => __('Link Color', 'ward'), 'section' => 'colors', 'settings' => 'ward_pro_theme_options[link_color]', 'priority' => 50)));
     $wp_customize->add_setting('ward_pro_theme_options[link_hover_color]', array('default' => $bavotasan_theme_options['link_hover_color'], 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'link_hover_color', array('label' => __('Link Hover Color', 'ward'), 'section' => 'colors', 'settings' => 'ward_pro_theme_options[link_hover_color]', 'priority' => 55)));
     $wp_customize->add_setting('ward_pro_theme_options[widget_area_color]', array('default' => $bavotasan_theme_options['widget_area_color'], 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'widget_area_color', array('label' => __('Widget Area Background Color', 'ward'), 'section' => 'colors', 'settings' => 'ward_pro_theme_options[widget_area_color]', 'priority' => 56)));
     // Nav panel
     $wp_customize->add_setting('ward_pro_theme_options[nav_palette]', array('default' => $bavotasan_theme_options['nav_palette'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_nav_palette', array('label' => __('Nav Color', 'ward'), 'section' => 'nav', 'settings' => 'ward_pro_theme_options[nav_palette]', 'priority' => 40, 'type' => 'select', 'choices' => array('navbar-default' => __('Light', 'ward'), 'navbar-inverse' => __('Dark', 'ward'))));
     // Posts panel
     $wp_customize->add_section('bavotasan_posts', array('title' => __('Posts', 'ward'), 'priority' => 45));
     $wp_customize->add_setting('ward_pro_theme_options[display_categories]', array('default' => $bavotasan_theme_options['display_categories'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_categories', array('label' => __('Display Categories', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_pro_theme_options[display_categories]', 'type' => 'checkbox'));
     $wp_customize->add_setting('ward_pro_theme_options[display_author]', array('default' => $bavotasan_theme_options['display_author'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_author', array('label' => __('Display Author', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_pro_theme_options[display_author]', 'type' => 'checkbox'));
     $wp_customize->add_setting('ward_pro_theme_options[display_date]', array('default' => $bavotasan_theme_options['display_date'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_date', array('label' => __('Display Date', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_pro_theme_options[display_date]', 'type' => 'checkbox'));
     $wp_customize->add_setting('ward_pro_theme_options[display_comment_count]', array('default' => $bavotasan_theme_options['display_comment_count'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_display_comment_count', array('label' => __('Display Comment Count', 'ward'), 'section' => 'bavotasan_posts', 'settings' => 'ward_pro_theme_options[display_comment_count]', 'type' => 'checkbox'));
     // Footer panel
     $wp_customize->add_section('bavotasan_footer', array('title' => __('Footer', 'ward'), 'priority' => 50));
     $wp_customize->add_setting('ward_pro_theme_options[extended_footer_columns]', array('default' => $bavotasan_theme_options['extended_footer_columns'], 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     $wp_customize->add_control('bavotasan_extended_footer_columns', array('label' => __('Extended Footer Columns', 'ward'), 'section' => 'bavotasan_footer', 'settings' => 'ward_pro_theme_options[extended_footer_columns]', 'priority' => 10, 'type' => 'select', 'choices' => array('col-md-12' => __('1 Column', 'ward'), 'col-md-6' => __('2 Columns', 'ward'), 'col-md-4' => __('3 Columns', 'ward'), 'col-md-3' => __('4 Columns', 'ward'), 'col-md-2' => __('6 Columns', 'ward'))));
     $wp_customize->add_setting('ward_pro_theme_options[copyright]', array('default' => $bavotasan_theme_options['copyright'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('bavotasan_copyright', array('label' => __('Copyright Notice', 'ward'), 'section' => 'bavotasan_footer', 'settings' => 'ward_pro_theme_options[copyright]', 'priority' => 20));
 }
Beispiel #6
0
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_default_theme_options = bavotasan_default_theme_options();
     $wp_customize->add_setting('tagline', array('default' => $bavotasan_default_theme_options['tagline'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('tagline', array('label' => __('Display Tagline', 'magazine-basic'), 'section' => 'title_tagline', 'type' => 'checkbox'));
     $wp_customize->add_setting('logo', array('default' => $bavotasan_default_theme_options['logo'], 'sanitize_callback' => 'esc_url'));
     $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array('label' => __('Site Logo', 'magazine-basic'), 'section' => 'title_tagline')));
     $wp_customize->add_setting('header_alignment', array('default' => $bavotasan_default_theme_options['header_alignment'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('header_alignment', array('label' => __('Header Alignment', 'magazine-basic'), 'section' => 'title_tagline', 'type' => 'select', 'choices' => array('fl' => __('Left', 'magazine-basic'), 'fr' => __('Right', 'magazine-basic'), 'center' => __('Center', 'magazine-basic'))));
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'magazine-basic'), 'priority' => 35));
     $wp_customize->add_setting('width', array('default' => $bavotasan_default_theme_options['width'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('width', array('label' => __('Site Width', 'magazine-basic'), 'section' => 'bavotasan_layout', 'type' => 'select', 'priority' => 10, 'choices' => array('' => '1200px', 'w960' => '960px')));
     $wp_customize->add_setting('layout', array('default' => $bavotasan_default_theme_options['layout'], 'sanitize_callback' => 'esc_attr'));
     $layout_choices = array('left' => __('Left', 'magazine-basic'), 'right' => __('Right', 'magazine-basic'));
     if (is_active_sidebar('second-sidebar')) {
         $layout_choices['separate'] = __('Separate', 'magazine-basic');
     }
     $wp_customize->add_control(new Bavotasan_Post_Layout_Control($wp_customize, 'layout', array('label' => __('Sidebar Layout', 'magazine-basic'), 'section' => 'bavotasan_layout', 'size' => false, 'priority' => 15, 'choices' => $layout_choices)));
     $choices = array('c2' => '17%', 'c3' => '25%', 'c4' => '34%', 'c5' => '42%', 'c6' => '50%', 'c7' => '58%', 'c8' => '66%', 'c9' => '75%', 'c10' => '83%');
     $wp_customize->add_setting('primary', array('default' => $bavotasan_default_theme_options['primary'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('primary', array('label' => __('Main Content Width', 'magazine-basic'), 'section' => 'bavotasan_layout', 'priority' => 20, 'type' => 'select', 'choices' => $choices));
     if (is_active_sidebar('second-sidebar')) {
         $wp_customize->add_setting('secondary', array('default' => $bavotasan_default_theme_options['secondary'], 'sanitize_callback' => 'esc_attr'));
         $wp_customize->add_control('secondary', array('label' => __('First Sidebar Width', 'magazine-basic'), 'section' => 'bavotasan_layout', 'priority' => 25, 'type' => 'select', 'choices' => $choices));
     }
     $wp_customize->add_setting('display_categories', array('default' => $bavotasan_default_theme_options['display_categories'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_categories', array('label' => __('Display Categories on inner pages', 'magazine-basic'), 'section' => 'bavotasan_layout', 'priority' => 30, 'type' => 'checkbox'));
     $wp_customize->add_setting('display_author', array('default' => $bavotasan_default_theme_options['display_author'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_author', array('label' => __('Display Author on inner pages', 'magazine-basic'), 'section' => 'bavotasan_layout', 'priority' => 35, 'type' => 'checkbox'));
     $wp_customize->add_setting('display_date', array('default' => $bavotasan_default_theme_options['display_date'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_date', array('label' => __('Display Date on inner pages', 'magazine-basic'), 'section' => 'bavotasan_layout', 'priority' => 40, 'type' => 'checkbox'));
     $wp_customize->add_setting('display_comment_count', array('default' => $bavotasan_default_theme_options['display_comment_count'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('display_comment_count', array('label' => __('Display Comment Count on inner pages', 'magazine-basic'), 'section' => 'bavotasan_layout', 'priority' => 45, 'type' => 'checkbox'));
     $wp_customize->add_section('bavotasan_front_page', array('title' => __('Front Page', 'magazine-basic'), 'priority' => 40));
     $wp_customize->add_setting('excerpt_content', array('default' => $bavotasan_default_theme_options['excerpt_content'], 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('excerpt_content', array('label' => __('Post Content Display', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'type' => 'radio', 'choices' => array('excerpt' => __('Teaser Excerpt', 'magazine-basic'), 'content' => __('Full Content', 'magazine-basic')), 'priority' => 25));
     $wp_customize->add_setting('grid', array('default' => $bavotasan_default_theme_options['grid'], 'sanitize_callback' => array($this, 'sanitize_int')));
     $wp_customize->add_control('grid', array('label' => __('Grid Layout', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'type' => 'radio', 'choices' => array('1' => __('Single', 'magazine-basic'), '2' => __('Single - Two Columns', 'magazine-basic'), '3' => __('Single - Two Columns - Three Columns', 'magazine-basic'), '4' => __('Single - Three Columns', 'magazine-basic')), 'priority' => 30));
     $wp_customize->add_setting('number', array('default' => $bavotasan_default_theme_options['number'], 'sanitize_callback' => array($this, 'sanitize_int')));
     $wp_customize->add_control('number', array('label' => __('Number of Posts', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'priority' => 35));
     $wp_customize->add_setting('index_categories', array('default' => $bavotasan_default_theme_options['index_categories'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('index_categories', array('label' => __('Display Categories', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'type' => 'checkbox', 'priority' => 40));
     $wp_customize->add_setting('index_author', array('default' => $bavotasan_default_theme_options['index_author'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('index_author', array('label' => __('Display Author', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'type' => 'checkbox', 'priority' => 45));
     $wp_customize->add_setting('index_date', array('default' => $bavotasan_default_theme_options['index_date'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('index_date', array('label' => __('Display Date', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'type' => 'checkbox', 'priority' => 50));
     $wp_customize->add_setting('index_comment_count', array('default' => $bavotasan_default_theme_options['index_comment_count'], 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('index_comment_count', array('label' => __('Display Comment Count', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'type' => 'checkbox', 'priority' => 55));
     // Image sizes
     $wp_customize->add_setting('1_image_width', array('default' => $bavotasan_default_theme_options['1_image_width'], 'sanitize_callback' => array($this, 'sanitize_int')));
     $wp_customize->add_control('1_image_width', array('label' => __('1 Column Image Width (pixels)', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'priority' => 60));
     $wp_customize->add_setting('2_image_width', array('default' => $bavotasan_default_theme_options['2_image_width'], 'sanitize_callback' => array($this, 'sanitize_int')));
     $wp_customize->add_control('2_image_width', array('label' => __('2 Column Image Width (pixels)', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'priority' => 70));
     $wp_customize->add_setting('3_image_width', array('default' => $bavotasan_default_theme_options['3_image_width'], 'sanitize_callback' => array($this, 'sanitize_int')));
     $wp_customize->add_control('3_image_width', array('label' => __('3 Column Image Width (pixels)', 'magazine-basic'), 'section' => 'bavotasan_front_page', 'priority' => 80));
     // Colors
     $wp_customize->add_setting('page_background', array('default' => $bavotasan_default_theme_options['page_background'], 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'page_background', array('label' => __('Page Background', 'magazine-basic'), 'section' => 'colors')));
     $wp_customize->add_setting('link_color', array('default' => $bavotasan_default_theme_options['link_color'], 'sanitize_callback' => 'sanitize_hex_color'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'link_color', array('label' => __('Link Color', 'magazine-basic'), 'section' => 'colors')));
 }
Beispiel #7
0
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0
  */
 public function customize_register($wp_customize)
 {
     $lobster_theme_options = lobster_theme_options();
     // Layout section panel
     $wp_customize->add_section('lobster_layout', array('title' => __('Layout', 'lobster'), 'priority' => 35));
     $wp_customize->add_setting('lobster_theme_options[width]', array('default' => $lobster_theme_options['width'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_width', array('label' => __('Site Width', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[width]', 'priority' => 10, 'type' => 'select', 'choices' => array('1200' => __('1200px', 'lobster'), '960' => __('960px', 'lobster'))));
     $wp_customize->add_setting('lobster_theme_options[layout]', array('default' => $lobster_theme_options['layout'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_site_layout', array('label' => __('Site Layout', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[layout]', 'priority' => 15, 'type' => 'radio', 'choices' => array('1' => __('1 Sidebar - Left', 'lobster'), '2' => __('1 Sidebar - Right', 'lobster'), '6' => __('No Sidebars', 'lobster'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%', 'col-md-12' => '100%');
     $wp_customize->add_setting('lobster_theme_options[primary]', array('default' => $lobster_theme_options['primary'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_primary_column', array('label' => __('Main Content', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[primary]', 'priority' => 20, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('lobster_theme_options[excerpt_content]', array('default' => $lobster_theme_options['excerpt_content'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_excerpt_content', array('label' => __('Post Content Display', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[excerpt_content]', 'priority' => 30, 'type' => 'radio', 'choices' => array('excerpt' => __('Teaser Excerpt', 'lobster'), 'content' => __('Full Content', 'lobster'))));
     $wp_customize->add_setting('lobster_theme_options[home_widget]', array('default' => $lobster_theme_options['home_widget'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_home_widget', array('label' => __('Display Home Page Top Widget Area', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[home_widget]', 'priority' => 35, 'type' => 'checkbox'));
     $wp_customize->add_setting('lobster_theme_options[home_posts]', array('default' => $lobster_theme_options['home_posts'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_home_posts', array('label' => __('Display Home Page Posts', 'lobster'), 'section' => 'lobster_layout', 'settings' => 'lobster_theme_options[home_posts]', 'priority' => 40, 'type' => 'checkbox'));
     // Jumbo headline section panel
     $wp_customize->add_section('lobster_jumbo', array('title' => __('Jumbo Headline', 'lobster'), 'priority' => 36));
     $wp_customize->add_setting('lobster_theme_options[jumbo_headline_title]', array('default' => $lobster_theme_options['jumbo_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_jumbo_headline_title', array('label' => __('Jumbo Headline Title', 'lobster'), 'section' => 'lobster_jumbo', 'settings' => 'lobster_theme_options[jumbo_headline_title]', 'priority' => 26, 'type' => 'text'));
     $wp_customize->add_setting('lobster_theme_options[jumbo_headline_text]', array('default' => $lobster_theme_options['jumbo_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_jumbo_headline_text', array('label' => __('Jumbo Headline Text', 'lobster'), 'section' => 'lobster_jumbo', 'settings' => 'lobster_theme_options[jumbo_headline_text]', 'priority' => 27, 'type' => 'text'));
     // Posts panel
     $wp_customize->add_section('lobster_posts', array('title' => __('Posts', 'lobster'), 'priority' => 45));
     $wp_customize->add_setting('lobster_theme_options[display_categories]', array('default' => $lobster_theme_options['display_categories'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_display_categories', array('label' => __('Display Categories', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_categories]', 'type' => 'checkbox'));
     $wp_customize->add_setting('lobster_theme_options[display_author]', array('default' => $lobster_theme_options['display_author'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_display_author', array('label' => __('Display Author', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_author]', 'type' => 'checkbox'));
     $wp_customize->add_setting('lobster_theme_options[display_date]', array('default' => $lobster_theme_options['display_date'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_display_date', array('label' => __('Display Date', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_date]', 'type' => 'checkbox'));
     $wp_customize->add_setting('lobster_theme_options[display_comment_count]', array('default' => $lobster_theme_options['display_comment_count'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_display_comment_count', array('label' => __('Display Comment Count', 'lobster'), 'section' => 'lobster_posts', 'settings' => 'lobster_theme_options[display_comment_count]', 'type' => 'checkbox'));
     // Custom header section panel
     $wp_customize->add_section('lobster_cust_header', array('title' => __('Custom Header', 'lobster'), 'priority' => 54));
     $wp_customize->add_setting('lobster_theme_options[cust_header_headline_title]', array('default' => $lobster_theme_options['cust_header_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_cust_header_headline_title', array('label' => __('Custom Header Headline Title', 'lobster'), 'section' => 'lobster_cust_header', 'settings' => 'lobster_theme_options[cust_header_headline_title]', 'priority' => 34, 'type' => 'text'));
     $wp_customize->add_setting('lobster_theme_options[cust_header_headline_text]', array('default' => $lobster_theme_options['cust_header_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_cust_header_headline_text', array('label' => __('Custom Header Headline Text', 'lobster'), 'section' => 'lobster_cust_header', 'settings' => 'lobster_theme_options[cust_header_headline_text]', 'priority' => 38, 'type' => 'text'));
     $wp_customize->add_setting('lobster_theme_options[custom_header_display]', array('default' => $lobster_theme_options['custom_header_display'], 'type' => 'option', 'capability' => 'edit_theme_options'));
     $wp_customize->add_control('lobster_cust_header_display', array('label' => __('Display Custom Header and Header Image (This box must be ticked to enable the Header Image feature below.)', 'lobster'), 'section' => 'lobster_cust_header', 'settings' => 'lobster_theme_options[custom_header_display]', 'priority' => 25, 'type' => 'checkbox'));
 }
Beispiel #8
0
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_theme_options = bavotasan_theme_options();
     $wp_customize->add_setting('arcade_basic_theme_options[arc]', array('default' => $bavotasan_theme_options['arc'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint'));
     $wp_customize->add_control(new Bavotasan_Text_Description_Control($wp_customize, 'arc', array('label' => __('Arc Radius', 'arcade'), 'section' => 'title_tagline', 'settings' => 'arcade_basic_theme_options[arc]', 'description' => __('The space and rotation for each letter will be calculated using the arc radius and the width of the site title. Leave blank for no arc.', 'arcade'))));
     $wp_customize->add_setting('arcade_basic_theme_options[fittext]', array('default' => $bavotasan_theme_options['fittext'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_fittext', array('label' => __('Use Fittext for long site title', 'arcade'), 'section' => 'title_tagline', 'settings' => 'arcade_basic_theme_options[fittext]', 'type' => 'checkbox'));
     $wp_customize->add_setting('arcade_basic_theme_options[header_icon]', array('default' => $bavotasan_theme_options['header_icon'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control(new Bavotasan_Icon_Select_Control($wp_customize, 'header_icon', array('label' => __('Header Icon', 'arcade'), 'section' => 'title_tagline', 'settings' => 'arcade_basic_theme_options[header_icon]')));
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'arcade'), 'priority' => 35));
     $wp_customize->add_setting('arcade_basic_theme_options[width]', array('default' => $bavotasan_theme_options['width'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint'));
     $wp_customize->add_control('bavotasan_width', array('label' => __('Site Width', 'arcade'), 'section' => 'bavotasan_layout', 'settings' => 'arcade_basic_theme_options[width]', 'priority' => 10, 'type' => 'select', 'choices' => array('1170' => __('1200px', 'arcade'), '992' => __('992px', 'arcade'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%', 'col-md-12' => '100%');
     $wp_customize->add_setting('arcade_basic_theme_options[primary]', array('default' => $bavotasan_theme_options['primary'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('bavotasan_primary_column', array('label' => __('Main Content Width', 'arcade'), 'section' => 'bavotasan_layout', 'settings' => 'arcade_basic_theme_options[primary]', 'priority' => 15, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('arcade_basic_theme_options[layout]', array('default' => $bavotasan_theme_options['layout'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $layout_choices = array('left' => __('Left', 'arcade'), 'right' => __('Right', 'arcade'));
     $wp_customize->add_control(new Bavotasan_Post_Layout_Control($wp_customize, 'layout', array('label' => __('Sidebar Layout', 'arcade'), 'section' => 'bavotasan_layout', 'settings' => 'arcade_basic_theme_options[layout]', 'size' => false, 'priority' => 25, 'choices' => $layout_choices)));
     $colors = array('default' => __('Default', 'arcade'), 'info' => __('Light Blue', 'arcade'), 'primary' => __('Blue', 'arcade'), 'danger' => __('Red', 'arcade'), 'warning' => __('Yellow', 'arcade'), 'success' => __('Green', 'arcade'));
     // Jumbo headline section panel
     $wp_customize->add_section('bavotasan_jumbo', array('title' => __('Jumbo Headline', 'arcade'), 'priority' => 36, 'description' => __('This section appears below the header image on the home page. To remove it just delete all the content from the Title textarea.', 'arcade')));
     $wp_customize->add_setting('arcade_basic_theme_options[jumbo_headline_title]', array('default' => $bavotasan_theme_options['jumbo_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea'));
     $wp_customize->add_control(new Bavotasan_Textarea_Control($wp_customize, 'jumbo_headline_title', array('label' => __('Title', 'arcade'), 'section' => 'bavotasan_jumbo', 'settings' => 'arcade_basic_theme_options[jumbo_headline_title]', 'priority' => 26, 'type' => 'text')));
     $wp_customize->add_setting('arcade_basic_theme_options[jumbo_headline_text]', array('default' => $bavotasan_theme_options['jumbo_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea'));
     $wp_customize->add_control(new Bavotasan_Textarea_Control($wp_customize, 'jumbo_headline_text', array('label' => __('Text', 'arcade'), 'section' => 'bavotasan_jumbo', 'settings' => 'arcade_basic_theme_options[jumbo_headline_text]', 'priority' => 27, 'type' => 'text')));
     // Posts panel
     $wp_customize->add_section('bavotasan_posts', array('title' => __('Posts', 'arcade'), 'priority' => 45, 'description' => __('These options do not affect the home page post section.', 'arcade')));
     $wp_customize->add_setting('arcade_basic_theme_options[display_categories]', array('default' => $bavotasan_theme_options['display_categories'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_categories', array('label' => __('Display Categories', 'arcade'), 'section' => 'bavotasan_posts', 'settings' => 'arcade_basic_theme_options[display_categories]', 'type' => 'checkbox'));
     $wp_customize->add_setting('arcade_basic_theme_options[display_author]', array('default' => $bavotasan_theme_options['display_author'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_author', array('label' => __('Display Author', 'arcade'), 'section' => 'bavotasan_posts', 'settings' => 'arcade_basic_theme_options[display_author]', 'type' => 'checkbox'));
     $wp_customize->add_setting('arcade_basic_theme_options[display_date]', array('default' => $bavotasan_theme_options['display_date'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_date', array('label' => __('Display Date', 'arcade'), 'section' => 'bavotasan_posts', 'settings' => 'arcade_basic_theme_options[display_date]', 'type' => 'checkbox'));
     $wp_customize->add_setting('arcade_basic_theme_options[display_comment_count]', array('default' => $bavotasan_theme_options['display_comment_count'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_comment_count', array('label' => __('Display Comment Count', 'arcade'), 'section' => 'bavotasan_posts', 'settings' => 'arcade_basic_theme_options[display_comment_count]', 'type' => 'checkbox'));
 }
 /**
  * Adds theme options to the Customizer screen
  *
  * This function is attached to the 'customize_register' action hook.
  *
  * @param	class $wp_customize
  *
  * @since 1.0.0
  */
 public function customize_register($wp_customize)
 {
     $bavotasan_theme_options = bavotasan_theme_options();
     // Layout section panel
     $wp_customize->add_section('bavotasan_layout', array('title' => __('Layout', 'matheson'), 'priority' => 35));
     $wp_customize->add_setting('matheson_theme_options[width]', array('default' => $bavotasan_theme_options['width'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint'));
     $wp_customize->add_control('bavotasan_width', array('label' => __('Site Width', 'matheson'), 'section' => 'bavotasan_layout', 'settings' => 'matheson_theme_options[width]', 'priority' => 10, 'type' => 'select', 'choices' => array('1200' => __('1200px', 'matheson'), '992' => __('992px', 'matheson'))));
     $choices = array('col-md-2' => '17%', 'col-md-3' => '25%', 'col-md-4' => '34%', 'col-md-5' => '42%', 'col-md-6' => '50%', 'col-md-7' => '58%', 'col-md-8' => '66%', 'col-md-9' => '75%', 'col-md-10' => '83%', 'col-md-12' => '100%');
     $wp_customize->add_setting('matheson_theme_options[primary]', array('default' => $bavotasan_theme_options['primary'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('bavotasan_primary_column', array('label' => __('Main Content Width', 'matheson'), 'section' => 'bavotasan_layout', 'settings' => 'matheson_theme_options[primary]', 'priority' => 15, 'type' => 'select', 'choices' => $choices));
     $wp_customize->add_setting('matheson_theme_options[layout]', array('default' => $bavotasan_theme_options['layout'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $layout_choices = array('left' => __('Left', 'matheson'), 'right' => __('Right', 'matheson'));
     $wp_customize->add_control(new Bavotasan_Post_Layout_Control($wp_customize, 'layout', array('label' => __('Sidebar Layout', 'matheson'), 'section' => 'bavotasan_layout', 'settings' => 'matheson_theme_options[layout]', 'size' => false, 'priority' => 25, 'choices' => $layout_choices)));
     $wp_customize->add_setting('matheson_theme_options[excerpt_content]', array('default' => $bavotasan_theme_options['excerpt_content'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr'));
     $wp_customize->add_control('bavotasan_excerpt_content', array('label' => __('Post Content Display', 'matheson'), 'section' => 'bavotasan_layout', 'settings' => 'matheson_theme_options[excerpt_content]', 'priority' => 30, 'type' => 'radio', 'choices' => array('excerpt' => __('Teaser Excerpt', 'matheson'), 'content' => __('Full Content', 'matheson'))));
     // Jumbo headline section panel
     $wp_customize->add_section('bavotasan_jumbo', array('title' => __('Jumbo Headline', 'matheson'), 'priority' => 36, 'description' => __('This section appears below the slider/header image on the home page. To remove it just delete all the content from the Title textarea.', 'matheson')));
     $wp_customize->add_setting('matheson_theme_options[jumbo_headline_title]', array('default' => $bavotasan_theme_options['jumbo_headline_title'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea'));
     $wp_customize->add_control(new Bavotasan_Textarea_Control($wp_customize, 'jumbo_headline_title', array('label' => __('Title', 'matheson'), 'section' => 'bavotasan_jumbo', 'settings' => 'matheson_theme_options[jumbo_headline_title]', 'priority' => 26, 'type' => 'text')));
     $wp_customize->add_setting('matheson_theme_options[jumbo_headline_text]', array('default' => $bavotasan_theme_options['jumbo_headline_text'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_textarea'));
     $wp_customize->add_control(new Bavotasan_Textarea_Control($wp_customize, 'jumbo_headline_text', array('label' => __('Text', 'matheson'), 'section' => 'bavotasan_jumbo', 'settings' => 'matheson_theme_options[jumbo_headline_text]', 'priority' => 27, 'type' => 'text')));
     // Posts panel
     $wp_customize->add_section('bavotasan_posts', array('title' => __('Posts', 'matheson'), 'priority' => 45));
     $wp_customize->add_setting('matheson_theme_options[display_categories]', array('default' => $bavotasan_theme_options['display_categories'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_categories', array('label' => __('Display Categories', 'matheson'), 'section' => 'bavotasan_posts', 'settings' => 'matheson_theme_options[display_categories]', 'type' => 'checkbox'));
     $wp_customize->add_setting('matheson_theme_options[display_author]', array('default' => $bavotasan_theme_options['display_author'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_author', array('label' => __('Display Author', 'matheson'), 'section' => 'bavotasan_posts', 'settings' => 'matheson_theme_options[display_author]', 'type' => 'checkbox'));
     $wp_customize->add_setting('matheson_theme_options[display_date]', array('default' => $bavotasan_theme_options['display_date'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_date', array('label' => __('Display Date', 'matheson'), 'section' => 'bavotasan_posts', 'settings' => 'matheson_theme_options[display_date]', 'type' => 'checkbox'));
     $wp_customize->add_setting('matheson_theme_options[display_comment_count]', array('default' => $bavotasan_theme_options['display_comment_count'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'sanitize_checkbox')));
     $wp_customize->add_control('bavotasan_display_comment_count', array('label' => __('Display Comment Count', 'matheson'), 'section' => 'bavotasan_posts', 'settings' => 'matheson_theme_options[display_comment_count]', 'type' => 'checkbox'));
 }