remove_section() публичный Метод

Remove a customize section.
С версии: 3.4.0
public remove_section ( string $id )
$id string Section ID.
Пример #1
1
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function tesseract_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->add_panel('tesseract_general_options', array('priority' => 3, 'capability' => 'edit_theme_options', 'title' => 'General'));
    $wp_customize->add_panel('tesseract_header_options', array('priority' => 4, 'capability' => 'edit_theme_options', 'title' => 'Header Options'));
    $wp_customize->add_panel('tesseract_footer_options', array('priority' => 5, 'capability' => 'edit_theme_options', 'title' => 'Footer Options'));
    $wp_customize->add_panel('tesseract_layout', array('priority' => 7, 'capability' => 'edit_theme_options', 'title' => 'Layout Options'));
    $wp_customize->add_panel('tesseract_social', array('priority' => 8, 'capability' => 'edit_theme_options', 'title' => 'Social'));
    $wp_customize->get_section('title_tagline')->panel = 'tesseract_header_options';
    $wp_customize->get_section('title_tagline')->priority = 3;
    if ($wp_customize->get_section('static_front_page')) {
        $wp_customize->get_section('static_front_page')->panel = 'tesseract_general_options';
        $wp_customize->get_section('static_front_page')->priority = 4;
    }
    $wp_customize->get_section('background_image')->panel = 'tesseract_general_options';
    $wp_customize->get_section('background_image')->priority = 2;
    $wp_customize->get_section('colors')->panel = 'tesseract_general_options';
    $wp_customize->get_section('colors')->title = __('Background Color', 'tesseract');
    $wp_customize->get_section('colors')->priority = 1;
    $wp_customize->get_control('background_color')->label = __('Choose a background color', 'tesseract');
    $wp_customize->get_control('background_color')->description = __('(This is only for the site\'s generic background color. You can define header and footer background colors in the Header Options and Footer Options respectively.)', 'tesseract');
    $wp_customize->remove_section('header_image');
    $wp_customize->remove_section('nav');
    $wp_customize->remove_control('header_textcolor');
    require get_template_directory() . '/inc/sections/header-colors.php';
    require get_template_directory() . '/inc/sections/header-logo.php';
    require get_template_directory() . '/inc/sections/header-size.php';
    require get_template_directory() . '/inc/sections/header-menu.php';
    require get_template_directory() . '/inc/sections/header-content.php';
    require get_template_directory() . '/inc/sections/mobile-menu.php';
    require get_template_directory() . '/inc/sections/social/account01.php';
    require get_template_directory() . '/inc/sections/social/account02.php';
    require get_template_directory() . '/inc/sections/social/account03.php';
    require get_template_directory() . '/inc/sections/social/account04.php';
    require get_template_directory() . '/inc/sections/social/account05.php';
    require get_template_directory() . '/inc/sections/social/account06.php';
    require get_template_directory() . '/inc/sections/social/account07.php';
    require get_template_directory() . '/inc/sections/social/account08.php';
    require get_template_directory() . '/inc/sections/social/account09.php';
    require get_template_directory() . '/inc/sections/social/account10.php';
    require get_template_directory() . '/inc/sections/blog.php';
    require get_template_directory() . '/inc/sections/search-results.php';
    require get_template_directory() . '/inc/sections/footer-colors.php';
    require get_template_directory() . '/inc/sections/footer-size.php';
    require get_template_directory() . '/inc/sections/footer-logo.php';
    require get_template_directory() . '/inc/sections/footer-content.php';
    require get_template_directory() . '/inc/sections/woocommerce.php';
    //if ( $wp_customize->is_preview() && ! is_admin() )
    //add_action( 'wp_footer', 'tesseract_customize_preview', 21);
}
Пример #2
0
 /**
  * This hooks into 'customize_register' (available as of WP 3.4) and allows
  * you to add new sections and controls to the Theme Customize screen.
  *
  * Note: To enable instant preview, we have to actually write a bit of custom
  * javascript. See live_preview() for more.
  *
  * @see add_action('customize_register',$func)
  * @param \WP_Customize_Manager $wp_customize
  */
 public static function register($wp_customize)
 {
     // Remove sections and native settings will not be used in theme
     // Remove setcions
     $wp_customize->remove_section('title_tagline');
     $wp_customize->remove_section('background_image');
     $wp_customize->remove_section('front_page');
     // Remove setting
     $wp_customize->remove_setting('background_color');
     // New settings to the top section (native section [header_image ])
     // Logo
     $wp_customize->add_setting('logo', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => array($this, 'horizon_theme_sanitize_image'), 'transport' => 'refresh'));
     $wp_customize->add_control(new WP_Customize_Upload_Control($wp_customize, 'logo', array('label' => __('Site Logo top', 'horizon-theme'), 'section' => 'header_image', 'settings' => 'logo', 'priority' => 10)));
     // New settings for colors section (native section [colors])
     // Primary Color
     $wp_customize->add_setting('primary_color', array('default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'primary_color', array('label' => __('Primary Color', 'horizon-theme'), 'section' => 'colors', 'settings' => 'primary_color', 'priority' => 10)));
     // Secondary Color
     $wp_customize->add_setting('secondary_color', array('default' => '#aac54b', 'sanitize_callback' => 'sanitize_hex_color', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'secondary_color', array('label' => __('Secondary Color', 'horizon-theme'), 'section' => 'colors', 'settings' => 'secondary_color', 'priority' => 12)));
     // Dark Color
     $wp_customize->add_setting('dark_color', array('default' => 'rgba(41, 44, 46, 0.9)', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh'));
     $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'dark_color', array('label' => __('Dark Color', 'horizon-theme'), 'section' => 'colors', 'settings' => 'dark_color', 'type' => 'text')));
     // Ligth Gray
     $wp_customize->add_setting('light_gray', array('default' => '#9f9f9f', 'sanitize_callback' => 'sanitize_hex_color', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'refresh'));
     $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'light_gray', array('label' => __('Ligth Gray', 'horizon-theme'), 'section' => 'colors', 'settings' => 'light_gray', 'priority' => 16)));
 }
Пример #3
0
/**
 * Implement Theme Customizer additions and adjustments.
 *
 * @package		Riiskit
 * @subpackage	functions.php
 * @since		1.0.0
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function riiskit_theme_customizer($wp_customize)
{
    $wp_customize->remove_section('colors');
    $wp_customize->remove_section('background_image');
    $wp_customize->remove_section('static_front_page');
    // MOBILE
    // Mobile sidr.js menu on/off
    $wp_customize->add_section('developer', array('title' => __('Developer', 'riiskit'), 'priority' => 2, 'description' => __('Options for the developer.', 'riiskit')));
    // toggle/slideout selection
    $wp_customize->add_setting('developer_menu_type', array('default' => 'toggle-menu', 'type' => 'option', 'capability' => 'activate_plugins', 'sanitize_callback', 'riiskit_sanitize_menu_type'));
    $wp_customize->add_control('developer_menu_type', array('label' => __('Menutype', 'riiskit'), 'section' => 'developer', 'settings' => 'developer_menu_type', 'type' => 'select', 'choices' => array('toggle-menu' => 'Toggle', 'slideout-menu' => 'Slideout')));
    // SOCIAL
    $wp_customize->add_section('social', array('title' => __('Social', 'riiskit'), 'description' => __('Add links to your social profiles.', 'riiskit'), 'priority' => 135));
    $social_links = array();
    // Facebook
    $social_links[] = array('slug' => 'social_facebook_link', 'label' => 'Facebook');
    // Twitter
    $social_links[] = array('slug' => 'social_twitter_link', 'label' => 'Twitter');
    foreach ($social_links as $link) {
        // SETTINGS
        $wp_customize->add_setting($link['slug'], array('type' => 'option', 'sanitize_callback' => 'riiskit_sanitize_url'));
        // CONTROLS
        $wp_customize->add_control($link['slug'], array('label' => $link['label'], 'section' => 'social', 'settings' => $link['slug'], 'type' => 'text'));
    }
}
Пример #4
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function resolution_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->remove_section('header_textcolor');
    $wp_customize->remove_section('colors');
    $wp_customize->remove_section('header_image');
    $wp_customize->remove_section('background_image');
}
Пример #5
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function forward_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    // Optionally disable individual customizer options.
    //
    // $wp_customize->remove_control('blogdescription');
    // Optionally disable customizer sections.
    //
    $wp_customize->remove_section('background_image');
    $wp_customize->remove_section('colors');
}
Пример #6
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function landing_customize_register($wp_customize)
{
    $wp_customize->remove_section('static_front_page');
    $wp_customize->remove_section('title_tagline');
    $wp_customize->remove_control('blogdescription');
    $wp_customize->remove_control('display_header_text');
    $wp_customize->add_section('title_tagline', array('title' => __('Site Title & User Info', 'landing'), 'priority' => 20));
    $wp_customize->add_setting('username', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => 'EL Maxo', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return sanitize_text_field($str);
    }));
    $wp_customize->add_setting('userskills', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => 'web developer', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return sanitize_text_field($str);
    }));
    $wp_customize->add_setting('telephone', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => '+9999999999', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return sanitize_text_field($str);
    }));
    $wp_customize->add_setting('address', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => 'Lorem Ipsum - это текст-"рыба", часто используемый в печати и вэб-дизайне.', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return sanitize_text_field($str);
    }));
    $wp_customize->add_setting('email', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => '*****@*****.**', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return sanitize_email($str);
    }));
    $wp_customize->add_setting('birthday', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => '1988-04-03', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return sanitize_email($str);
    }));
    $wp_customize->add_setting('site', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => 'webdesign-master.ru', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return sanitize_text_field($str);
    }));
    $wp_customize->add_setting('prof_description', array('type' => 'theme_mod', 'capability' => 'edit_theme_options', 'default' => 'Проффестональное создание сайтов: разработка дизайна, верстка, посадка на CMS WOrdPress', 'transport' => 'postMessage', 'sanitize_callback' => function ($str) {
        return implode("\n", array_map('sanitize_text_field', explode("\n", $str)));
    }));
    $wp_customize->add_control('username', array('type' => 'text', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your name', 'landing')));
    $wp_customize->add_control('userskills', array('type' => 'text', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your speciality', 'landing')));
    $wp_customize->add_control('telephone', array('type' => 'text', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your telephone', 'landing')));
    $wp_customize->add_control('address', array('type' => 'textarea', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your address', 'landing')));
    $wp_customize->add_control('email', array('type' => 'text', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your email', 'landing')));
    $wp_customize->add_control('birthday', array('type' => 'date', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your birth day', 'landing')));
    $wp_customize->add_control('site', array('type' => 'text', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your site (without http://)', 'landing')));
    $wp_customize->add_control('prof_description', array('type' => 'textarea', 'priority' => 10, 'section' => 'title_tagline', 'label' => __('Your Professional Description', 'landing')));
    $wp_customize->add_section('logo', array('title' => __('Logo', 'landing'), 'description' => __('Select Your Logo', 'landing'), 'priority' => 90));
    $wp_customize->add_setting('logo', array('type' => 'theme_mod', 'default' => get_template_directory_uri() . '/img/logo.svg', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array('label' => __('Featured Logo', 'landing'), 'section' => 'logo', 'settings' => 'logo', 'mime_type' => 'image')));
    $wp_customize->add_section('photo', array('title' => __('Photo', 'landing'), 'description' => __('Select Your Photo', 'landing'), 'priority' => 90));
    $wp_customize->add_setting('photo', array('type' => 'theme_mod', 'default' => get_template_directory_uri() . '/img/photo.jpg', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'photo', array('label' => __('Your Photo', 'landing'), 'section' => 'photo', 'settings' => 'photo')));
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
}
 /**
  * Handle a section entry
  *
  * @param $id
  * @param array $data
  * @param array|null $settings
  * @param $panel_id
  */
 public function setSection($id, array $data, array $settings = null, $panel_id = null)
 {
     $section_data = $this->getSectionData($data, $panel_id);
     if (is_null($panel_id) && isset($data['panel'])) {
         $panel_id = $data['panel'];
     }
     if (is_null($settings) && isset($data['settings'])) {
         $settings = $data['settings'];
     }
     $item = $this->customizer->get_section($id);
     if ($item) {
         foreach ($data as $var => $val) {
             if (array_key_exists($var, $section_data)) {
                 $item->{$var} = $val;
             }
             if (!empty($panel_id)) {
                 $item->panel = $panel_id;
             }
         }
         if (isset($data['delete']) && $data['delete'] === true) {
             $this->customizer->remove_section($id);
         }
     } else {
         $this->customizer->add_section(new WP_Customize_Section($this->customizer, $id, $section_data));
     }
     if (!is_null($settings)) {
         $settings['object'] = 'settings';
         $settings['section'] = $id;
         $this->processData($settings);
     }
 }
Пример #8
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function esell_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('background_color')->transport = 'postMessage';
    $wp_customize->remove_section("background_image");
}
Пример #9
0
/**
 * Implement Theme Customizer additions and adjustments.
 *
 * The sanitiser functions are found in "inc/utility-functions.php".
 *
 * @package		Riiskit
 * @subpackage	functions.php
 * @since		1.0.0
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function riiskit_theme_customizer($wp_customize)
{
    $wp_customize->remove_section('colors');
    $wp_customize->remove_section('background_image');
    $wp_customize->remove_section('static_front_page');
    // SOCIAL
    $wp_customize->add_section('social', array('title' => __('Social', 'riiskit'), 'description' => __('Add links to your social profiles.', 'riiskit'), 'priority' => 135));
    $social_links = array();
    // Facebook
    $social_links[] = array('slug' => 'social_facebook_link', 'label' => 'Facebook');
    // Twitter
    $social_links[] = array('slug' => 'social_twitter_link', 'label' => 'Twitter');
    foreach ($social_links as $link) {
        // SETTINGS
        $wp_customize->add_setting($link['slug'], array('type' => 'option', 'sanitize_callback' => 'riiskit_sanitize_url'));
        // CONTROLS
        $wp_customize->add_control($link['slug'], array('label' => $link['label'], 'section' => 'social', 'settings' => $link['slug'], 'type' => 'text'));
    }
}
Пример #10
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 *
 * @return void
 */
function mindseyesociety_customize_register(WP_Customize_Manager $wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    // We don't need no stinkin' colors.
    $wp_customize->remove_section('colors');
    // Adds toggle for front page carousel.
    $wp_customize->add_setting('show_carousel', array('default' => false));
    $wp_customize->add_control('show_carousel', array('label' => __('Show Homepage Carousel', 'mindseyesociety'), 'section' => 'static_front_page', 'settings' => 'show_carousel', 'type' => 'checkbox'));
}
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function tesseract_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->add_panel('tesseract_general_options', array('priority' => 3, 'capability' => 'edit_theme_options', 'title' => 'General'));
    $wp_customize->add_panel('tesseract_header_options', array('priority' => 4, 'capability' => 'edit_theme_options', 'title' => 'Header Options'));
    $wp_customize->add_panel('tesseract_footer_options', array('priority' => 5, 'capability' => 'edit_theme_options', 'title' => 'Footer Options'));
    $wp_customize->add_panel('tesseract_social', array('priority' => 9999, 'capability' => 'edit_theme_options', 'title' => 'Social'));
    $wp_customize->get_section('title_tagline')->panel = 'tesseract_header_options';
    $wp_customize->get_section('title_tagline')->priority = 3;
    $wp_customize->get_section('static_front_page')->panel = 'tesseract_general_options';
    $wp_customize->get_section('static_front_page')->priority = 4;
    $wp_customize->get_section('background_image')->panel = 'tesseract_general_options';
    $wp_customize->get_section('background_image')->priority = 2;
    $wp_customize->get_section('colors')->panel = 'tesseract_general_options';
    $wp_customize->get_section('colors')->title = __('Background Color', 'tesseract');
    $wp_customize->get_section('colors')->priority = 1;
    $wp_customize->get_control('background_color')->label = __('Choose a background color', 'tesseract');
    $wp_customize->get_control('background_color')->description = __('(This is only for the site\'s generic background color. You can define header and footer background colors in the Header Options and Footer Options respectively.)', 'tesseract');
    $wp_customize->remove_section('header_image');
    $wp_customize->remove_section('nav');
    $wp_customize->remove_control('header_textcolor');
    require get_template_directory() . '/inc/sections/header-colors.php';
    require get_template_directory() . '/inc/sections/logo.php';
    require get_template_directory() . '/inc/sections/header-menu.php';
    require get_template_directory() . '/inc/sections/header-content.php';
    require get_template_directory() . '/inc/sections/social/facebook.php';
    require get_template_directory() . '/inc/sections/social/twitter.php';
    require get_template_directory() . '/inc/sections/social/googleplus.php';
    require get_template_directory() . '/inc/sections/social/linkedin.php';
    require get_template_directory() . '/inc/sections/social/youtube.php';
    require get_template_directory() . '/inc/sections/social/vimeo.php';
    require get_template_directory() . '/inc/sections/social/tumblr.php';
    require get_template_directory() . '/inc/sections/social/flickr.php';
    require get_template_directory() . '/inc/sections/social/pinterest.php';
    require get_template_directory() . '/inc/sections/social/dribbble.php';
    require get_template_directory() . '/inc/sections/footer-colors.php';
    require get_template_directory() . '/inc/sections/footer-content.php';
    if ($wp_customize->is_preview() && !is_admin()) {
        add_action('wp_footer', 'tesseract_customize_preview', 21);
    }
}
Пример #12
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function wgiinformer_customize_register($wp_customize)
{
    $sections_to_remove = array("colors", "header_image", "background_image");
    foreach ($sections_to_remove as $str) {
        $wp_customize->remove_section($str);
    }
    $controls_to_remove = array("blogdescription", "display_header_text");
    foreach ($controls_to_remove as $ctr) {
        $wp_customize->remove_control($ctr);
    }
}
Пример #13
0
 /**
  * Removes all non-AMP sections and panels.
  *
  * Provides a clean, standalone instance-like experience by removing all non-AMP registered panels and sections.
  *
  * @since 0.4
  * @access private
  */
 private function _unregister_core_ui()
 {
     $panels = $this->wp_customize->panels();
     $sections = $this->wp_customize->sections();
     foreach ($panels as $panel_id => $object) {
         $this->wp_customize->remove_panel($panel_id);
     }
     foreach ($sections as $section_id => $object) {
         $this->wp_customize->remove_section($section_id);
     }
 }
Пример #14
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function Metrika_customize_register($wp_customize)
{
    $fonts = Metrika_google_fonts();
    $font_list = array();
    foreach ($fonts as $key => $value) {
        $font_list[$key] = $value['name'];
    }
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->remove_section('title_tagline');
    $wp_customize->remove_section('static_front_page');
    $wp_customize->remove_section('nav');
    $wp_customize->add_section('metrika_color', array('title' => __('Default Theme Color', 'metrika'), 'priority' => 5));
    $wp_customize->add_section('metrika_settings', array('title' => __('Theme Style', 'metrika'), 'priority' => 10));
    $wp_customize->add_section('metrika_email_info', array('title' => __('E-mail Details', 'metrika'), 'priority' => 130));
    $wp_customize->add_section('metrika_contact_form', array('title' => __('Feedback', 'metrika'), 'priority' => 130));
    $wp_customize->add_setting('metrika_theme_options[color]', array('default' => 'd06e39', 'sanitize_callback' => 'sanitize_hex_color', 'capability' => 'edit_theme_options', 'type' => 'option'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color', array('label' => __('Color', 'metrika'), 'section' => 'metrika_color', 'settings' => 'metrika_theme_options[color]')));
    $wp_customize->add_setting('metrika_theme_options[menu_type]', array('default' => 'no', 'capability' => 'edit_theme_options', 'type' => 'option'));
    $wp_customize->add_control('metrika_menu_type', array('label' => __('', 'metrika'), 'section' => 'metrika_settings', 'settings' => 'metrika_theme_options[menu_type]', 'type' => 'radio', 'choices' => array('yes' => 'Metro', 'no' => 'Standart')));
}
Пример #15
0
/**
 * Register theme custom customizer settings.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function kihon_customize_register($wp_customize)
{
    /**
     * Configure some WP default settings to fit the theme
     */
    $wp_customize->remove_section('background_image');
    /**
     * Hook to easily add custom options.
     *
     * @since 1.0.0
     *
     * @param WP_Customize_Manager $wp_customize Theme Customizer object.
     */
    do_action('kihon_register_customizer_settings', $wp_customize);
    // Add customizer description control
    include get_template_directory() . '/inc/class-customizer-controls.php';
}
 public function customize_register(WP_Customize_Manager $customizeManager)
 {
     // this field will be checked in settings method
     PP_Customizer_Customizer()->settings->customizeManager = $customizeManager;
     $settings = PP_Customizer_Customizer()->settings->get_settings();
     foreach ($settings as $sectionID => $isEnabled) {
         if ($isEnabled == 'false') {
             $panel = $customizeManager->get_panel($sectionID);
             if (isset($panel) && $panel != null) {
                 // is a panel, remove it
                 $customizeManager->remove_panel($sectionID);
             } else {
                 $customizeManager->remove_section($sectionID);
             }
         }
     }
 }
Пример #17
0
 /**
  * This hooks into 'customize_register' (available as of WP 3.4) and allows
  * you to add new sections and controls to the Theme Customize screen.
  *
  * Note: To enable instant preview, we have to actually write a bit of custom
  * javascript. See live_preview() for more.
  *
  * @see add_action('customize_register',$func)
  * @param \WP_Customize_Manager $wp_customize
  */
 public static function register($wp_customize)
 {
     /**
      * Failsafe is safe
      */
     if (!isset($wp_customize)) {
         return;
     }
     // Remove sections and native settings will not be used in theme
     // Remove setcions
     //$wp_customize->remove_section( 'title_tagline' );
     $wp_customize->remove_section('background_image');
     // Remove setting
     $wp_customize->remove_setting('background_color');
     self::register_options_for_header_image($wp_customize);
     self::register_pages_title_section($wp_customize);
     self::register_options_section($wp_customize);
 }
Пример #18
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function elset_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->remove_section('colors');
    if (class_exists('WP_Customize_Panel')) {
        $wp_customize->add_panel('panel_general', ['priority' => 30, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('General Options', 'elset')]);
        $wp_customize->add_section('elset_general_section', ['title' => __('General', 'elset'), 'priority' => 30, 'panel' => 'panel_general']);
        $wp_customize->add_setting('elset_logo', ['sanitize_callback' => 'esc_url_raw']);
        $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_logo', ['label' => __('Logo', 'elset'), 'section' => 'elset_general_section', 'settings' => 'elset_logo', 'priority' => 1]));
        $wp_customize->add_setting('elset_copyright', ['sanitize_callback' => 'elset_sanitize_text', 'default' => __('My web', 'elset')]);
        $wp_customize->add_control('elset_copyright', ['label' => __('Copyright', 'elset'), 'section' => 'elset_general_section', 'settings' => 'elset_copyright', 'priority' => 2]);
        $wp_customize->add_section('elset_apps_section', ['title' => __('Apps section', 'elset'), 'priority' => 35, 'description' => __('Main content is customizable in Customize -> Widgets')]);
        $wp_customize->add_section('elset_apps_show', ['sanitize_callback' => 'elset_sanitize_text']);
        $wp_customize->add_control('elset_apps_show', ['type' => 'checkbox', 'label' => __('Hide apps section'), 'section' => 'elset_apps_section', 'priority' => 1]);
        $wp_customize->add_section('elset_apps_title', ['sanitize_callback' => 'elset_sanitize_text', 'default' => __('Our apps section')]);
        $wp_customize->add_control('elset_apps_title', ['label' => __('Hide apps title', 'elset'), 'section' => 'elset_apps_section', 'settings' => 'elset_apps_title', 'priority' => 2]);
    }
}
Пример #19
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function corp_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->remove_section('colors');
    if (class_exists('WP_customize_Panel')) {
        $wp_customize->add_panel('panel_general', ['priority' => 30, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('General Settings', 'corp')]);
        $wp_customize->add_section('corp_general_section', ['title' => __('General', 'corp'), 'priority' => 30, 'panel' => 'panel_general']);
        $wp_customize->add_setting('corp_logo', ['sanitize_callback' => 'esc_url_raw']);
        $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_logo', ['label' => __('Logo', 'corp'), 'section' => 'corp_general_section', 'settings' => 'corp_logo', 'priority' => 1]));
    }
    /**
     * ABOUT SECTION
     */
    $wp_customize->add_section('corp_about', ['title' => __('About section', 'corp'), 'priority' => 31]);
    /*show/hide*/
    $wp_customize->add_setting('corp_about', ['sanitize_callback' => 'corp_sanitize_text']);
    $wp_customize->add_control('corp_about', ['type' => 'checkbox', 'label' => __('Hide about row?', 'corp'), 'section' => 'corp_about', 'priority' => 1]);
}
Пример #20
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function responsiveboat_customize_register($wp_customize)
{
    /* Remove About us section */
    $wp_customize->remove_panel('panel_about');
    $wp_customize->remove_section('zerif_aboutus_settings_section');
    $wp_customize->remove_section('zerif_aboutus_main_section');
    $wp_customize->remove_section('zerif_aboutus_feat1_section');
    $wp_customize->remove_section('zerif_aboutus_feat2_section');
    $wp_customize->remove_section('zerif_aboutus_feat3_section');
    $wp_customize->remove_section('zerif_aboutus_feat4_section');
    $wp_customize->remove_section('zerif_aboutus_clients_section');
    $wp_customize->remove_section('zerif_contactus_section');
    /**************************************/
    /********** Big title image **********/
    /*************************************/
    $wp_customize->add_setting('rb_bigtitle_logo', array('sanitize_callback' => 'esc_url_raw', 'default' => get_stylesheet_directory_uri() . '/images/logo-small.png'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'rb_bigtitle_logo', array('label' => __('Header Logo', 'responsiveboat'), 'section' => 'zerif_bigtitle_section', 'priority' => 7)));
    /**************************************/
    /********   About me section *********/
    /*************************************/
    $wp_customize->add_section('rb_aboutyou_section', array('title' => __('About you section', 'responsiveboat'), 'priority' => 34));
    /* about you show/hide */
    $wp_customize->add_setting('rb_aboutyou_show', array('sanitize_callback' => 'responsiveboat_sanitize_text'));
    $wp_customize->add_control('rb_aboutyou_show', array('type' => 'checkbox', 'label' => __('Hide about you section?', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 1));
    /* title */
    $wp_customize->add_setting('rb_aboutyou_title', array('sanitize_callback' => 'responsiveboat_sanitize_text', 'default' => __('About you', 'responsiveboat')));
    $wp_customize->add_control('rb_aboutyou_title', array('label' => __('Title', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 2));
    /* subtitle */
    $wp_customize->add_setting('rb_aboutyou_subtitle', array('sanitize_callback' => 'responsiveboat_sanitize_text', 'default' => __('Use this section to showcase important details about you.', 'responsiveboat')));
    $wp_customize->add_control('rb_aboutyou_subtitle', array('label' => __('Subtitle', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 3));
    /* text */
    $wp_customize->add_setting('rb_aboutyou_text', array('sanitize_callback' => 'responsiveboat_sanitize_text', 'default' => __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec massa enim. Aliquam viverra at est ullamcorper sollicitudin. Proin a leo sit amet nunc malesuada imperdiet pharetra ut eros.<br><br> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec massa enim. Aliquam viverra at est ullamcorper sollicitudin. Proin a leo sit amet nunc malesuada imperdiet pharetra ut eros. <br><br>Mauris vel nunc at ipsum fermentum pellentesque quis ut massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas non adipiscing massa. Sed ut fringilla sapien. Cras sollicitudin, lectus sed tincidunt cursus, magna lectus vehicula augue, a lobortis dui orci et est.', 'responsiveboat')));
    $wp_customize->add_control('rb_aboutyou_text', array('label' => __('Text', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 4));
    /* image */
    $wp_customize->add_setting('rb_aboutyou_image', array('sanitize_callback' => 'esc_url_raw', 'default' => get_stylesheet_directory_uri() . '/images/about.jpg'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'rb_aboutyou_image', array('label' => __('Image', 'responsiveboat'), 'section' => 'rb_aboutyou_section', 'priority' => 5)));
}
Пример #21
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function gannet_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    // Remove Header Text color control
    $wp_customize->remove_control('display_header_text');
    $wp_customize->remove_control('header_textcolor');
    // $wp_customize->get_control( 'display_header_text' )->priority = 10;
    // $wp_customize->get_control( 'header_textcolor' )->label = __( 'Site Tagline Color', 'gannet' );
    // $wp_customize->get_control( 'header_textcolor' )->section = 'title_tagline';
    // $wp_customize->get_control( 'header_textcolor' )->priority = 15;
    // $wp_customize->get_setting( 'header_textcolor' )->default = '7bcaf7';
    // Remove Background Color Control
    $wp_customize->remove_control('background_color');
    // Move Background Image control into Layout section & remove Background Image section
    $wp_customize->get_control('background_image')->section = 'layout';
    $wp_customize->get_control('background_image')->priority = 20;
    $wp_customize->remove_section('background_image');
    // Move Header Image control into Layout section & remove Header Image section
    $wp_customize->get_control('header_image')->section = 'layout';
    $wp_customize->get_control('header_image')->priority = 20;
    $wp_customize->remove_section('header_image');
    // ddd($wp_customize);
}
Пример #22
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function awaken_customize_register($wp_customize)
{
    require get_template_directory() . '/inc/customizer/custom-controls/control-category-dropdown.php';
    require get_template_directory() . '/inc/customizer/custom-controls/control-custom-content.php';
    $wp_customize->remove_section('themes');
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->get_section('static_front_page')->panel = 'awaken_home_settings';
    $wp_customize->get_section('background_image')->panel = 'awaken_styling';
    $wp_customize->get_section('colors')->panel = 'awaken_styling';
    /**
     * Header Settings Panel
     */
    $wp_customize->add_panel('awaken_header_settings', array('title' => __('Header Settings', 'awaken'), 'description' => __('Use this panel to set your header settings', 'awaken'), 'priority' => 25));
    // Logo image
    $wp_customize->add_setting('site_logo', array('sanitize_callback' => 'awaken_sanitize_image'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'site_logo', array('label' => __('Site Logo', 'awaken'), 'section' => 'title_tagline', 'settings' => 'site_logo', 'description' => __('Upload a logo for your website. Recommended height for your logo is 135px.', 'awaken'))));
    // Logo, title and description chooser
    $wp_customize->add_setting('site_title_option', array('default' => 'text-only', 'sanitize_callback' => 'awaken_sanitize_logo_title_select', 'transport' => 'refresh'));
    $wp_customize->add_control('site_title_option', array('label' => __('Display site title / logo.', 'awaken'), 'section' => 'title_tagline', 'type' => 'radio', 'description' => __('Choose your preferred option.', 'awaken'), 'choices' => array('text-only' => __('Display site title and description only.', 'awaken'), 'logo-only' => __('Display site logo image only.', 'awaken'), 'text-logo' => __('Display both site title and logo image.', 'awaken'), 'display-none' => __('Display none', 'awaken'))));
    // Site favicon
    $wp_customize->add_setting('site_favicon', array('sanitize_callback' => 'awaken_sanitize_image'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'site_favicon', array('label' => __('Upload a favicon', 'awaken'), 'section' => 'title_tagline', 'settings' => 'site_favicon', 'description' => __('Upload a favicon for your website.', 'awaken'))));
    // Display site favicon?
    $wp_customize->add_setting('display_site_favicon', array('default' => false, 'sanitize_callback' => 'awaken_sanitize_checkbox'));
    $wp_customize->add_control('display_site_favicon', array('settings' => 'display_site_favicon', 'section' => 'title_tagline', 'type' => 'checkbox', 'label' => __('Display site favicon?', 'awaken')));
    /**
     * General settings section.
     */
    $wp_customize->add_section('awaken_general_settings', array('title' => __('General Settings', 'awaken'), 'description' => __('Use this section to set general settings of the site.', 'awaken'), 'priority' => 30));
    // Read more text.
    $wp_customize->add_setting('read_more_text', array('default' => '[...]', 'sanitize_callback' => 'awaken_sanitize_html'));
    $wp_customize->add_control('read_more_text', array('settings' => 'read_more_text', 'section' => 'awaken_general_settings', 'type' => 'textarea', 'label' => __('Read more text', 'awaken'), 'description' => __('Give a read more text for posts. HTML allowed.', 'awaken')));
    // Footer copyright text.
    $wp_customize->add_setting('footer_copyright_text', array('default' => sprintf(__('Copyright %s. All rights reserved.', 'awaken'), esc_html(get_bloginfo('name'))), 'sanitize_callback' => 'awaken_sanitize_html'));
    $wp_customize->add_control('footer_copyright_text', array('settings' => 'footer_copyright_text', 'section' => 'awaken_general_settings', 'type' => 'textarea', 'label' => __('Footer copyright text', 'awaken'), 'description' => __('Copyright or other text to be displayed in the site footer. HTML allowed.', 'awaken')));
    /**
     * Home Settings section.
     */
    $wp_customize->add_panel('awaken_home_settings', array('title' => __('Homepage Settings', 'awaken'), 'description' => __('Use this panel to set your home page settings', 'awaken'), 'priority' => 31));
    /**
     * Slider Section.
     */
    $wp_customize->add_section('awaken_slider', array('title' => __('Feartured Slider', 'awaken'), 'description' => __('Use this section to setup the homepage slider and featured posts.', 'awaken'), 'panel' => 'awaken_home_settings'));
    // Display slider?
    $wp_customize->add_setting('display_slider', array('default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox'));
    $wp_customize->add_control('display_slider', array('settings' => 'display_slider', 'section' => 'awaken_slider', 'type' => 'checkbox', 'label' => __('Display slider on homepage ?', 'awaken')));
    $wp_customize->add_setting('slider_category', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_category_dropdown'));
    $wp_customize->add_control(new WP_Customize_Category_Control($wp_customize, 'slider_category', array('label' => __('Select the category for slider.', 'awaken'), 'description' => __('Featured images of the posts from selected category will be displayed in the slider', 'awaken'), 'section' => 'awaken_slider', 'settings' => 'slider_category')));
    $wp_customize->add_setting('featured_posts_category', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_category_dropdown'));
    $wp_customize->add_control(new WP_Customize_Category_Control($wp_customize, 'featured_posts_category', array('label' => __('Select the category for featured posts.', 'awaken'), 'description' => __('Featured images of the posts from selected category will be displayed in the slider', 'awaken'), 'section' => 'awaken_slider', 'settings' => 'featured_posts_category')));
    /**
     * Post / Page settings
     */
    $wp_customize->add_section('awaken_post_page_settings', array('title' => __('Post / Page Settings', 'awaken'), 'priority' => 32));
    // Show comments on posts.
    $wp_customize->add_setting('display_post_comments', array('default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox'));
    $wp_customize->add_control('display_post_comments', array('settings' => 'display_post_comments', 'section' => 'awaken_post_page_settings', 'type' => 'checkbox', 'label' => __('Display post comments.', 'awaken'), 'description' => __('Mark the checkbox if you want to display comments on post articles.', 'awaken')));
    // Show comments on pages.
    $wp_customize->add_setting('display_page_comments', array('default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox'));
    $wp_customize->add_control('display_page_comments', array('settings' => 'display_page_comments', 'section' => 'awaken_post_page_settings', 'type' => 'checkbox', 'label' => __('Display page comments.', 'awaken'), 'description' => __('Mark the checkbox if you want to display comments on pages.', 'awaken')));
    // Show featured image in single posts.
    $wp_customize->add_setting('show_article_featured_image', array('default' => true, 'sanitize_callback' => 'awaken_sanitize_checkbox'));
    $wp_customize->add_control('show_article_featured_image', array('settings' => 'show_article_featured_image', 'section' => 'awaken_post_page_settings', 'type' => 'checkbox', 'label' => __('Display featured image inside the single post article.', 'awaken'), 'description' => __('Mark the checkbox if you want to show featured image on single post article.', 'awaken')));
    /**
     * Styling Options.
     */
    $wp_customize->add_panel('awaken_styling', array('title' => __('Site Styling', 'awaken'), 'description' => __('Use this section to setup the homepage slider and featured posts.', 'awaken'), 'priority' => 33));
    /**
     * Custom CSS section
     */
    $wp_customize->add_section('awaken_custom_css', array('title' => __('Custom CSS', 'awaken'), 'panel' => 'awaken_styling', 'priority' => 50));
    $wp_customize->add_setting('custom_css', array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'awaken_sanitize_css'));
    $wp_customize->add_control('custom_css', array('settings' => 'custom_css', 'section' => 'awaken_custom_css', 'type' => 'textarea', 'label' => __('Custom CSS', 'awaken'), 'description' => __('Define custom CSS be used for your site. Do not enclose in script tags.', 'awaken')));
    /**
     * Social Media
     */
    $wp_customize->add_section('awaken_social_media', array('title' => __('Social Media', 'awaken'), 'priority' => 34));
    $wp_customize->add_setting('display_social_icons', array('default' => false, 'sanitize_callback' => 'awaken_sanitize_checkbox'));
    $wp_customize->add_control('display_social_icons', array('settings' => 'display_social_icons', 'section' => 'awaken_social_media', 'type' => 'checkbox', 'label' => __('Display social icons?', 'awaken')));
    $wp_customize->add_setting('facebook_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('facebook_url', array('settings' => 'facebook_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('Facebook URL', 'awaken')));
    $wp_customize->add_setting('twitter_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('twitter_url', array('settings' => 'twitter_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('Twitter URL', 'awaken')));
    $wp_customize->add_setting('google_plus_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('google_plus_url', array('settings' => 'google_plus_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('Google Plus URL', 'awaken')));
    $wp_customize->add_setting('linkedin_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('linkedin_url', array('settings' => 'linkedin_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('Linkedin URL', 'awaken')));
    $wp_customize->add_setting('rss_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('rss_url', array('settings' => 'rss_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('RSS URL', 'awaken')));
    $wp_customize->add_setting('instagram_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('instagram_url', array('settings' => 'instagram_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('Instagram URL', 'awaken')));
    $wp_customize->add_setting('flickr_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('flickr_url', array('settings' => 'flickr_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('Flickr URL', 'awaken')));
    $wp_customize->add_setting('youtube_url', array('default' => '', 'sanitize_callback' => 'awaken_sanitize_url'));
    $wp_customize->add_control('youtube_url', array('settings' => 'youtube_url', 'section' => 'awaken_social_media', 'type' => 'url', 'label' => __('Youtube URL', 'awaken')));
    $wp_customize->add_section('awaken_pro_details', array('title' => __('Awaken Pro', 'awaken'), 'priority' => 120));
    $wp_customize->add_setting('awaken_pro_desc', array('sanitize_callback' => 'awaken_sanitize_html'));
    $wp_customize->add_control(new Awaken_Pro_Custom_Content($wp_customize, 'awaken_pro_desc', array('section' => 'awaken_pro_details', 'priority' => 20, 'label' => __('Do you want more features?', 'awaken'), 'content' => __('Then consider buying <a href="http://themezhut.com/themes/awaken-pro/" target="_blank">Awaken Pro.</a><h4>Awaken Pro Features.</h4><ol><li>Ajaxified Post Widgets.</li><li>Google Fonts.</li><li>Unlimited Colors.</li><li>Boxed and Wide Layouts.</li><li>More Customizer Options.</li><li>Custom slider.</li><li>Different sidebars for articles and pages.</li><li>Released under GPL.</li></ol>And more..<p><a class="button" href="http://themezhut.com/demo/awaken-pro/" target="_blank">Awaken Pro Demo</a><a class="button button-primary" href="http://themezhut.com/themes/awaken-pro/" target="_blank">Awaken Pro Details</a></p>', 'awaken') . '</p>')));
}
Пример #23
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function nulis_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    // Remove unused section
    $wp_customize->remove_section('background_image');
    $wp_customize->remove_section('colors');
    // Color Section
    $wp_customize->add_section('nulis_color', array('priority' => 2, 'title' => __('Colorized Your Blog', 'nulis'), 'description' => __('Choose your favourite color to match with your character.', 'nulis')));
    $wp_customize->get_control('header_textcolor')->section = 'nulis_color';
    $wp_customize->get_control('header_textcolor')->priority = 1;
    $wp_customize->get_control('header_textcolor')->description = __('Change site title & description default color.', 'nulis');
    $wp_customize->add_setting('nulis_accent_color', array('default' => '#FFC600', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'nulis_accent_color', array('label' => __('Accent Color', 'nulis'), 'section' => 'nulis_color', 'settings' => 'nulis_accent_color')));
    $wp_customize->add_setting('nulis_main_color', array('default' => '#F3F7F9', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'nulis_main_color', array('label' => __('Toolbar Background', 'nulis'), 'section' => 'nulis_color', 'settings' => 'nulis_main_color')));
    $wp_customize->add_setting('nulis_about_me_color', array('default' => '#FFFFFF', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'nulis_about_me_color', array('label' => __('About Me Background', 'nulis'), 'section' => 'nulis_color', 'settings' => 'nulis_about_me_color')));
    $wp_customize->add_setting('nulis_aboutme_text_color', array('default' => '#A5B2B9', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'nulis_aboutme_text_color', array('label' => __('About Me Text', 'nulis'), 'section' => 'nulis_color', 'settings' => 'nulis_aboutme_text_color')));
    $wp_customize->add_setting('nulis_footer_text_color', array('default' => '#A5B2B9', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'nulis_footer_text_color', array('label' => __('Footer Text', 'nulis'), 'section' => 'nulis_color', 'settings' => 'nulis_footer_text_color')));
    // Logo Section
    $wp_customize->add_section('nulis_logo_image', array('priority' => 2, 'title' => __('Upload Avatar', 'nulis'), 'description' => __('Add avatar/personal logo to your blog. You can use either Gravatar or upload your custom avatar by choosing options below.', 'nulis')));
    // Use Gravatar Setting
    $wp_customize->add_setting('nulis_use_gravatar', array('default' => '', 'sanitize_callback' => 'nulis_sanitize_checkbox'));
    $wp_customize->add_control('nulis_use_gravatar', array('label' => __('Use gravatar', 'nulis'), 'section' => 'nulis_logo_image', 'type' => 'checkbox', 'description' => __('To use Gravatar simply check options above and write your Gravatar email address in the box below.', 'nulis')));
    // Gravatar Email Setting
    $wp_customize->add_setting('gravatar_email', array('default' => '', 'sanitize_callback' => 'is_email'));
    $wp_customize->add_control('gravatar_email', array('label' => '', 'section' => 'nulis_logo_image', 'type' => 'text'));
    $wp_customize->add_setting('nulis_logo_image', array('default' => '', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'nulis_logo_images', array('label' => __('Self Upload', 'nulis'), 'section' => 'nulis_logo_image', 'settings' => 'nulis_logo_image', 'description' => __('Upload your custom avatar/logo by clicking select image button below. Nulis theme recommends avatar/logo size 200x200 pixels.', 'nulis'))));
    // Excerpt Options
    $wp_customize->add_section('nulis_post_excerpts', array('priority' => 3, 'title' => __('Post Excerpts', 'nulis'), 'description' => __('Auto generate excerpts.', 'nulis')));
    $wp_customize->add_setting('nulis_excerpt_options', array('default' => '', 'sanitize_callback' => 'nulis_sanitize_checkbox'));
    $wp_customize->add_control('nulis_excerpt_options', array('label' => __('Use excerpts', 'nulis'), 'section' => 'nulis_post_excerpts', 'type' => 'checkbox', 'description' => __('Enabling this option will generate auto excerpt to your blog.', 'nulis')));
    // Social Links
    $wp_customize->add_section('nulis_social_links', array('priority' => 4, 'title' => __('Social Links', 'nulis'), 'description' => __('Add social links to your blog.', 'nulis')));
    $wp_customize->add_setting('nulis_dribbble_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_dribbble_link', array('label' => __('Dribbble Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 1));
    $wp_customize->add_setting('nulis_facebook_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_facebook_link', array('label' => __('Facebook Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 2));
    $wp_customize->add_setting('nulis_flickr_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_flickr_link', array('label' => __('Flickr Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 3));
    $wp_customize->add_setting('nulis_github_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_github_link', array('label' => __('Github Plus Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 4));
    $wp_customize->add_setting('nulis_linkedin_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_linkedin_link', array('label' => __('LinkedIn Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 5));
    $wp_customize->add_setting('nulis_pinterest_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_pinterest_link', array('label' => __('Pinterest Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 6));
    $wp_customize->add_setting('nulis_rss_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_rss_link', array('label' => __('RSS Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 7));
    $wp_customize->add_setting('nulis_tumblr_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_tumblr_link', array('label' => __('Tumblr Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 8));
    $wp_customize->add_setting('nulis_twitter_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_twitter_link', array('label' => __('Twitter Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 9));
    $wp_customize->add_setting('nulis_vimeo_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_vimeo_link', array('label' => __('Vimeo Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 10));
    $wp_customize->add_setting('nulis_youtube_link', array('default' => '', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('nulis_youtube_link', array('label' => __('Youtube Link', 'nulis'), 'section' => 'nulis_social_links', 'type' => 'text', 'priority' => 11));
    // Register textarea control
    class Nulis_Textarea_Control extends WP_Customize_Control
    {
        public $type = 'textarea';
        public function render_content()
        {
            ?>
			<label>
				<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
				<textarea rows="5" style="width:100%;" <?php 
            $this->link();
            ?>
><?php 
            echo esc_textarea($this->value());
            ?>
</textarea>
			</label>
			<?php 
        }
    }
    // About Me Section
    $wp_customize->add_section('nulis_profile', array('title' => __('About Me', 'nulis'), 'description' => __('Write short description about you. To use this feature, please check options below. This text will hide current site title & site description appear in the footer section.', 'nulis'), 'priority' => 5));
    $wp_customize->add_setting('nulis_hide_footer_title_description', array('default' => '', 'sanitize_callback' => 'nulis_sanitize_checkbox'));
    $wp_customize->add_control('nulis_hide_footer_title_description', array('label' => __('Use this feature', 'nulis'), 'section' => 'nulis_profile', 'type' => 'checkbox', 'priority' => 10));
    // Fullname Setting
    $wp_customize->add_setting('nulis_fullname', array('default' => 'Add your name', 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('nulis_fullname_control', array('settings' => 'nulis_fullname', 'label' => __('Add your name', 'nulis'), 'section' => 'nulis_profile', 'type' => 'text', 'priority' => 11));
    // Short Profile Setting
    $wp_customize->add_setting('nulis_short_profile', array('default' => '', 'sanitize_callback' => 'nulis_sanitize_text'));
    $wp_customize->add_control(new Nulis_Textarea_Control($wp_customize, 'nulis_short_profile', array('label' => __('Short Profile', 'nulis'), 'section' => 'nulis_profile', 'description' => __(' Please note that only the "a" and "br" HTML tags are allowed.', 'nulis'), 'priority' => 12)));
}
Пример #24
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function cw_magazine_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    $wp_customize->remove_section('colors');
    /********************/
    /*** theme notes ***/
    /*******************/
    class cw_magazine_Theme_Support extends WP_Customize_Control
    {
        public function render_content()
        {
        }
    }
    $wp_customize->add_section('cwp_theme_notes', array('title' => __('Theme Support', 'cw-magazine'), 'description' => __("Thank you for being part of this! We've spent almost 6 months building ThemeIsle without really knowing if anyone will ever use a theme or not, so we're very grateful that you've decided to work with us. Wanna <a href='http://themeisle.com/contact/' target='_blank'>say hi</a>?\n\t\t<br/><br/> <a href='http://themeisle.com/forums/forum/cw-magazine/' target='_blank'>Support Forum</a> | <a href='https://themeisle.com/documentation-cw-magazine' target='_blank'>Documentation</a>", 'cw-magazine'), 'priority' => 1));
    $wp_customize->add_setting('cwp_theme_notes', array('sanitize_callback' => 'cwp_sanitize_theme_notes'));
    $wp_customize->add_control(new cw_magazine_Theme_Support($wp_customize, 'cwp_theme_notes', array('section' => 'cwp_theme_notes')));
    /*****************************/
    /***** front page slider *****/
    /*****************************/
    $wp_customize->add_section('cw_slider_section', array('title' => __('Front page slider', 'cw-magazine'), 'priority' => 30));
    $wp_customize->add_setting('cwp_slide_img1', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_slider_image1', array('label' => __('Slider image 1', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_img1', 'priority' => 1)));
    $wp_customize->add_setting('cwp_slide_link1', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('cwp_slide_link1', array('label' => __('Slider link 1', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_link1', 'priority' => 2));
    $wp_customize->add_setting('cwp_slide_caption_title1', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_title1', array('label' => __('Slider caption title 1', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_title1', 'priority' => 3));
    $wp_customize->add_setting('cwp_slide_caption_text1', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_text1', array('label' => __('Slider caption text 1', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_text1', 'priority' => 4));
    $wp_customize->add_setting('cwp_slide_img2', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_slider_image2', array('label' => __('Slider image 2', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_img2', 'priority' => 5)));
    $wp_customize->add_setting('cwp_slide_link2', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('cwp_slide_link2', array('label' => __('Slider link 2', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_link2', 'priority' => 6));
    $wp_customize->add_setting('cwp_slide_caption_title2', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_title2', array('label' => __('Slider caption title 2', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_title2', 'priority' => 7));
    $wp_customize->add_setting('cwp_slide_caption_text2', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_text2', array('label' => __('Slider caption text 2', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_text2', 'priority' => 8));
    $wp_customize->add_setting('cwp_slide_img3', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_slider_image3', array('label' => __('Slider image 3', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_img3', 'priority' => 9)));
    $wp_customize->add_setting('cwp_slide_link3', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('cwp_slide_link3', array('label' => __('Slider link 3', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_link3', 'priority' => 10));
    $wp_customize->add_setting('cwp_slide_caption_title3', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_title3', array('label' => __('Slider caption title 3', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_title3', 'priority' => 11));
    $wp_customize->add_setting('cwp_slide_caption_text3', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_text3', array('label' => __('Slider caption text 3', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_text3', 'priority' => 12));
    $wp_customize->add_setting('cwp_slide_img4', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_slider_image4', array('label' => __('Slider image 4', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_img4', 'priority' => 13)));
    $wp_customize->add_setting('cwp_slide_link4', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control('cwp_slide_link4', array('label' => __('Slider link 4', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_link4', 'priority' => 14));
    $wp_customize->add_setting('cwp_slide_caption_title4', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_title4', array('label' => __('Slider caption title 4', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_title4', 'priority' => 15));
    $wp_customize->add_setting('cwp_slide_caption_text4', array('sanitize_callback' => 'esc_attr'));
    $wp_customize->add_control('cwp_slide_caption_text4', array('label' => __('Slider caption text 4', 'cw-magazine'), 'section' => 'cw_slider_section', 'settings' => 'cwp_slide_caption_text4', 'priority' => 16));
    /************************************/
    /********* SOCIALS ******************/
    /************************************/
    $wp_customize->add_section('cw_socials_section', array('title' => __('Social icons', 'cw-magazine'), 'priority' => 35));
    $wp_customize->add_setting('facebook_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('facebook_link', array('label' => __('Facebook link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'facebook_link', 'priority' => 1));
    $wp_customize->add_setting('gplus_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('gplus_link', array('label' => __('Google Plus link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'gplus_link', 'priority' => 2));
    $wp_customize->add_setting('twitter_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('twitter_link', array('label' => __('Twitter link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'twitter_link', 'priority' => 3));
    $wp_customize->add_setting('linkedin_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('linkedin_link', array('label' => __('Linkedin link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'linkedin_link', 'priority' => 4));
    $wp_customize->add_setting('youtube_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('youtube_link', array('label' => __('Youtube link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'youtube_link', 'priority' => 5));
    $wp_customize->add_setting('rss_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('rss_link', array('label' => __('RSS link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'rss_link', 'priority' => 6));
    $wp_customize->add_setting('vimeo_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('vimeo_link', array('label' => __('Vimeo link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'vimeo_link', 'priority' => 7));
    $wp_customize->add_setting('yelp_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('yelp_link', array('label' => __('Yelp link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'yelp_link', 'priority' => 8));
    $wp_customize->add_setting('pinterest_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('pinterest_link', array('label' => __('Pinterest link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'pinterest_link', 'priority' => 9));
    $wp_customize->add_setting('stumbleupon_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('stumbleupon_link', array('label' => __('Stumbleupon link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'stumbleupon_link', 'priority' => 10));
    $wp_customize->add_setting('tumblr_link', array('sanitize_callback' => 'esc_url_raw', 'default' => '#'));
    $wp_customize->add_control('tumblr_link', array('label' => __('Tumblr link', 'cw-magazine'), 'section' => 'cw_socials_section', 'settings' => 'tumblr_link', 'priority' => 11));
    $wp_customize->add_section('cw_logo_section', array('title' => __('Logo', 'cw-magazine'), 'priority' => 36));
    /****************************/
    /********* Logo *************/
    /****************************/
    $wp_customize->add_setting('logo_header', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_logo', array('label' => __('Logo', 'cw-magazine'), 'section' => 'cw_logo_section', 'settings' => 'logo_header')));
    /****************************/
    /********** Copyright ******/
    /***************************/
    $wp_customize->add_section('cw_copyright_section', array('title' => __('Copyright', 'cw-magazine'), 'priority' => 37));
    $wp_customize->add_setting('cw_copyright', array('sanitize_callback' => 'cwp_sanitize_text'));
    $wp_customize->add_control('cw_copyright', array('label' => __('Copyright', 'cw-magazine'), 'section' => 'cw_copyright_section', 'settings' => 'cw_copyright'));
    /****************************/
    /********* Template *********/
    /****************************/
    $wp_customize->add_section('cw_template_section', array('title' => __('Select template', 'cw-magazine'), 'priority' => 38));
    $wp_customize->add_setting('select_template', array('sanitize_callback' => 'cwp_sanitize_theme_notes', 'default' => 'sidebar_right'));
    $wp_customize->add_control('select_template', array('type' => 'radio', 'label' => 'Template', 'section' => 'cw_template_section', 'choices' => array('sidebar_right' => 'Sidebar right', 'sidebar_left' => 'Sidebar left', 'full_width' => 'Full width')));
    /******************************/
    /******* Color scheme *********/
    /*******************************/
    $wp_customize->add_section('cw_colorscheme_section', array('title' => __('Color scheme', 'cw-magazine'), 'priority' => 39));
    $wp_customize->add_setting('color_scheme', array('sanitize_callback' => 'cwp_sanitize_theme_notes', 'default' => 'cw_magazine'));
    $wp_customize->add_control('color_scheme', array('type' => 'radio', 'label' => 'Color scheme', 'section' => 'cw_colorscheme_section', 'choices' => array('none' => 'None', 'cw_magazine' => 'CW Magazine', 'red_style' => 'Red style', 'fashion_style' => 'Fashion style', 'sports_blog' => 'Sports blog')));
    /*************************************************/
    /************* Site colors ***********************/
    /*************************************************/
    $wp_customize->add_section('cw_sitecolors_section', array('title' => __('Site colors', 'cw-magazine'), 'priority' => 41, 'description' => __('Make sure no color scheme is selected! Check None on Color scheme tab for this colors to change. ', 'cw-magazine')));
    $wp_customize->add_setting('site_color_3', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_color_3', array('label' => __('Page title', 'cw-magazine'), 'section' => 'cw_sitecolors_section', 'settings' => 'site_color_3')));
    $wp_customize->add_setting('site_color_2', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_color_2', array('label' => __('Widget title', 'cw-magazine'), 'section' => 'cw_sitecolors_section', 'settings' => 'site_color_2')));
    $wp_customize->add_setting('site_color_1', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_color_1', array('label' => __('Background widget title', 'cw-magazine'), 'section' => 'cw_sitecolors_section', 'settings' => 'site_color_1')));
    $wp_customize->add_setting('site_color_4', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_color_4', array('label' => __('Links color', 'cw-magazine'), 'section' => 'cw_sitecolors_section', 'settings' => 'site_color_4')));
    $wp_customize->add_setting('site_color_5', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_color_5', array('label' => __('Links color (mouse over)', 'cw-magazine'), 'section' => 'cw_sitecolors_section', 'settings' => 'site_color_5')));
    $wp_customize->add_setting('site_color_6', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'site_color_6', array('label' => __('Color background page', 'cw-magazine'), 'section' => 'cw_sitecolors_section', 'settings' => 'site_color_6')));
    $wp_customize->add_setting('site_bg_1', array('sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'themeslug_site_bg_1', array('label' => __('Image background page', 'cw-magazine'), 'section' => 'cw_sitecolors_section', 'settings' => 'site_bg_1')));
    /****************************************/
    /********* Header colors ****************/
    /****************************************/
    $wp_customize->add_section('cw_headercolors_section', array('title' => __('Header colors', 'cw-magazine'), 'priority' => 42, 'description' => __('Make sure no color scheme is selected! Check None on Color scheme tab for this colors to change. ', 'cw-magazine')));
    $wp_customize->add_setting('header_color_1', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_1', array('label' => __('Background', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_1')));
    $wp_customize->add_setting('header_color_11', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_11', array('label' => __('Site title color', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_11')));
    $wp_customize->add_setting('header_color_12', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_12', array('label' => __('Site Tagline color', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_12')));
    $wp_customize->add_setting('header_color_2', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_2', array('label' => __('Main menu background', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_2')));
    $wp_customize->add_setting('header_color_3', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_3', array('label' => __('Main menu links', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_3')));
    $wp_customize->add_setting('header_color_4', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_4', array('label' => __('Main menu links (mouse over)', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_4')));
    $wp_customize->add_setting('header_color_5', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_5', array('label' => __('Very top menu background', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_5')));
    $wp_customize->add_setting('header_color_6', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_6', array('label' => __('Very top menu links', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_6')));
    $wp_customize->add_setting('header_color_7', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_7', array('label' => __('Very top menu links (mouse over)', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_7')));
    $wp_customize->add_setting('header_color_8', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_8', array('label' => __('Social icon links', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_8')));
    $wp_customize->add_setting('header_color_9', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color_9', array('label' => __('Social icon links (mouse over)', 'cw-magazine'), 'section' => 'cw_headercolors_section', 'settings' => 'header_color_9')));
    /******************************/
    /***** Footer Text colors *****/
    /******************************/
    $wp_customize->add_section('cw_footertextcolors_section', array('title' => __('Footer colors', 'cw-magazine'), 'priority' => 43, 'description' => __('Make sure no color scheme is selected! Check None on Color scheme tab for this colors to change. ', 'cw-magazine')));
    $wp_customize->add_setting('footer_color_1', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'footer_color_1', array('label' => __('Background', 'cw-magazine'), 'section' => 'cw_footertextcolors_section', 'settings' => 'footer_color_1')));
    $wp_customize->add_setting('footer_color_2', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'footer_color_2', array('label' => __('Title color', 'cw-magazine'), 'section' => 'cw_footertextcolors_section', 'settings' => 'footer_color_2')));
    $wp_customize->add_setting('footer_color_3', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'footer_color_3', array('label' => __('Text color', 'cw-magazine'), 'section' => 'cw_footertextcolors_section', 'settings' => 'footer_color_3')));
    $wp_customize->add_setting('footer_color_4', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'footer_color_4', array('label' => __('Link color', 'cw-magazine'), 'section' => 'cw_footertextcolors_section', 'settings' => 'footer_color_4')));
    $wp_customize->add_setting('footer_color_5', array('sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'footer_color_5', array('label' => __('Link color (mouse over)', 'cw-magazine'), 'section' => 'cw_footertextcolors_section', 'settings' => 'footer_color_5')));
}
Пример #25
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function amalgamation_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->remove_section('header_image');
    $wp_customize->remove_section('background_image');
    $wp_customize->remove_control('background_color');
    $wp_customize->remove_control('header_textcolor');
    $wp_customize->add_section('front_page_content', array('title' => __('Front Page Content', 'amalgamation'), 'description' => __('Content of panels of static front page. Does not apply if your front page is your blog archive.', 'amalgamation')));
    // post dropdown custom control modified from Tom Rhodes'
    // https://github.com/tommusrhodus/wp-cusomizer-posts-dropdown
    if (class_exists('WP_Customize_Control')) {
        class Post_Dropdown_Control extends WP_Customize_Control
        {
            public function render_content()
            {
                ?>
                <label>
                    <span class="customize-control-title"><?php 
                echo esc_html($this->label);
                ?>
</span>
                    <select data-customize-setting-link="<?php 
                echo $this->id;
                ?>
">
                        <?php 
                $posts = get_posts('numberposts=-1');
                foreach ($posts as $post) {
                    ?>
                            <option value="<?php 
                    echo $post->ID;
                    ?>
" <?php 
                    if (get_theme_mod($this->id) == $post->ID) {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo $post->post_title;
                    ?>
</option>
                        <?php 
                }
                ?>
                    </select>
                </label>
                <?php 
            }
        }
    }
    $wp_customize->add_setting('fp_panel_1', array('default' => 'latest', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('fp_panel_1', array('label' => __('Content of panel 1 (upper left)', 'amalgamation'), 'description' => __('Includes title, excerpt, and featured image if any.', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'radio', 'choices' => array('page' => __('Page', 'amalgamation'), 'latest' => __('Latest blog post', 'amalgamation'), 'post' => __('Fixed blog post', 'amalgamation'))));
    $wp_customize->add_setting('panel_1_page', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('panel_1_page', array('label' => __('Page to show', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'dropdown-pages'));
    $wp_customize->add_setting('panel_1_post', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control(new Post_Dropdown_Control($wp_customize, 'panel_1_post', array('label' => __('Post to show', 'amalgamation'), 'section' => 'front_page_content', 'settings' => 'panel_1_post')));
    $wp_customize->add_setting('fp_panel_2', array('default' => 'latest', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('fp_panel_2', array('label' => __('Content of panel 2 (upper right)', 'amalgamation'), 'description' => __('Includes title, excerpt, and featured image if any.', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'radio', 'choices' => array('page' => __('Page', 'amalgamation'), 'latest' => __('Latest blog post', 'amalgamation'), 'post' => __('Fixed blog post', 'amalgamation'))));
    $wp_customize->add_setting('panel_2_page', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('panel_2_page', array('label' => __('Page to show', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'dropdown-pages'));
    $wp_customize->add_setting('panel_2_post', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control(new Post_Dropdown_Control($wp_customize, 'panel_2_post', array('label' => __('Post to show', 'amalgamation'), 'section' => 'front_page_content', 'settings' => 'panel_2_post')));
    $wp_customize->add_setting('fp_panel_3', array('default' => 'latest', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('fp_panel_3', array('label' => __('Content of panel 3 (lower left)', 'amalgamation'), 'description' => __('Includes title, excerpt, and featured image if any.', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'radio', 'choices' => array('page' => __('Page', 'amalgamation'), 'latest' => __('Latest blog post', 'amalgamation'), 'post' => __('Fixed blog post', 'amalgamation'))));
    $wp_customize->add_setting('panel_3_page', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('panel_3_page', array('label' => __('Page to show', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'dropdown-pages'));
    $wp_customize->add_setting('panel_3_post', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control(new Post_Dropdown_Control($wp_customize, 'panel_3_post', array('label' => __('Post to show', 'amalgamation'), 'section' => 'front_page_content', 'settings' => 'panel_3_post')));
    $wp_customize->add_setting('fp_panel_4', array('default' => 'latest', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('fp_panel_4', array('label' => __('Content of panel 4 (lower right)', 'amalgamation'), 'description' => __('Includes title, excerpt, and featured image if any.', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'radio', 'choices' => array('page' => __('Page', 'amalgamation'), 'latest' => __('Latest blog post', 'amalgamation'), 'post' => __('Fixed blog post', 'amalgamation'))));
    $wp_customize->add_setting('panel_4_page', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control('panel_4_page', array('label' => __('Page to show', 'amalgamation'), 'section' => 'front_page_content', 'type' => 'dropdown-pages'));
    $wp_customize->add_setting('panel_4_post', array('default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage'));
    $wp_customize->add_control(new Post_Dropdown_Control($wp_customize, 'panel_4_post', array('label' => __('Post to show', 'amalgamation'), 'section' => 'front_page_content', 'settings' => 'panel_4_post')));
    $wp_customize->add_section('archive_length', array('title' => __('Blog Archives', 'amalgamation'), 'description' => __('Choose whether blog archive pages show full content or post excerpts.', 'amalgamation')));
    $wp_customize->add_setting('archive_length_setting', array('default' => 'full', 'sanitize_callback' => 'sanitize_text_field'));
    $wp_customize->add_control('archive_length_setting', array('label' => __('Blog archives show:', 'amalgamation'), 'section' => 'archive_length', 'type' => 'radio', 'choices' => array('full' => __('Full content', 'amalgamation'), 'excerpt' => __('Excerpts', 'amalgamation'))));
}
Пример #26
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize
 *        	Theme Customizer object.
 */
function loungeact_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    // Remove wp header image section
    $wp_customize->remove_section('header_image');
    $loungeact = new Lounge_Act_Theme();
    // ============== STYLES AND COLORS ==============
    $wp_customize->add_section('loungeact_header_styles', array('title' => esc_html__('Colors', 'loungeact'), 'panel' => 'loungeact_header', 'priority' => 30));
    // Header background color opacity on scroll
    $wp_customize->add_setting('loungeact[header_background_opacity_inside_slider]', array('default' => $loungeact->get_setting('header_background_opacity_inside_slider'), 'type' => 'option'));
    $wp_customize->add_control('loungeact_header_background_opacity_inside_slider', array('label' => esc_html__('Background opacity inside slider', 'loungeact'), 'description' => esc_html__('Opacity applied only if the header is inside a slider.', 'loungeact'), 'section' => 'loungeact_header_styles', 'settings' => 'loungeact[header_background_opacity_inside_slider]', 'type' => 'range', 'priority' => 30, 'input_attrs' => array('min' => 0, 'max' => 1, 'step' => 0.1)));
    // Site title color
    $wp_customize->add_setting('loungeact[site_title_color]', array('default' => $loungeact->get_setting('site_title_color'), 'type' => 'option'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'loungeact_site_title_color', array('label' => esc_html__('Site title color', 'loungeact'), 'section' => 'loungeact_header_styles', 'settings' => 'loungeact[site_title_color]', 'priority' => 40)));
    // Blogdescription color
    $wp_customize->add_setting('loungeact[blogdescription_color]', array('default' => $loungeact->get_setting('blogdescription_color'), 'type' => 'option'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'blogdescription_color', array('label' => esc_html__('Site description color', 'loungeact'), 'section' => 'loungeact_header_styles', 'settings' => 'loungeact[blogdescription_color]', 'priority' => 50)));
    // Logo
    $wp_customize->add_setting('loungeact[font_family_title]', array('default' => $loungeact->get_setting("font_family_title"), 'type' => 'option'));
    $wp_customize->add_control(new Google_Font_Dropdown_Custom_Control($wp_customize, 'loungeact_font_family_title', array('label' => esc_html__('Title font family', 'loungeact'), 'section' => 'title_tagline', 'settings' => 'loungeact[font_family_title]', 'priority' => 25)));
    // Logo
    $wp_customize->add_setting('loungeact[hide_title_in_homepage]', array('default' => $loungeact->get_setting("hide_title_in_homepage"), 'type' => 'option'));
    $wp_customize->add_control('loungeact_hide_title_in_homepage', array('label' => esc_html__('Hide header text in homepage', 'loungeact'), 'section' => 'title_tagline', 'settings' => 'loungeact[hide_title_in_homepage]', 'type' => 'checkbox', 'priority' => 40));
    // Logo max height
    $wp_customize->add_setting('loungeact[logo_max_height]', array('default' => $loungeact->get_setting("logo_max_height"), 'type' => 'option'));
    $wp_customize->add_control('loungeact_logo_max_height', array('label' => esc_html__('Site logo max height', 'loungeact'), 'description' => esc_html__('Define also the unit system like px,% ...', 'loungeact'), 'section' => 'title_tagline', 'settings' => 'loungeact[logo_max_height]', 'priority' => 200));
    /*
     * ============== SLIDER ==============
     */
    $wp_customize->add_section('loungeact_slider', array('title' => esc_html__('Slider', 'loungeact'), 'priority' => 30));
    // slide opacity
    $wp_customize->add_setting('loungeact[slide_overlay_opacity]', array('default' => $loungeact->get_setting('slide_overlay_opacity'), 'type' => 'option'));
    $wp_customize->add_control('loungeact_slide_overlay_opacity', array('label' => esc_html__('Slide overlay opacity', 'loungeact'), 'section' => 'loungeact_slider', 'settings' => 'loungeact[slide_overlay_opacity]', 'type' => 'range', 'priority' => 40, 'input_attrs' => array('min' => 0, 'max' => 1, 'step' => 0.1), 'active_callback' => 'loungeact_slider_selected'));
    // slide only in home
    $wp_customize->add_setting('loungeact[slider_only_in_homepage]', array('default' => $loungeact->get_setting('slider_only_in_homepage'), 'type' => 'option'));
    $wp_customize->add_control('loungeact_slider_only_in_homepage', array('label' => esc_html__('Show only in homepage', 'loungeact'), 'section' => 'loungeact_slider', 'settings' => 'loungeact[slider_only_in_homepage]', 'type' => 'checkbox', 'priority' => 60, 'active_callback' => 'loungeact_slider_selected'));
    /*
     * ============== Style ==============
     */
    $wp_customize->add_panel('loungeact_styles', array('title' => esc_html__('Styles', 'loungeact'), 'priority' => 30));
    $wp_customize->add_section('loungeact_typography', array('title' => esc_html__('Typography', 'loungeact'), 'panel' => 'loungeact_styles', 'priority' => 10));
    $wp_customize->add_setting('loungeact[font_family_default]', array('default' => $loungeact->get_setting('font_family_default'), 'type' => 'option'));
    $wp_customize->add_control(new Google_Font_Dropdown_Custom_Control($wp_customize, 'loungeact_font_family_default', array('label' => esc_html__('Default font family', 'loungeact'), 'section' => 'loungeact_typography', 'settings' => 'loungeact[font_family_default]', 'priority' => 10)));
    $wp_customize->add_setting('loungeact[font_family_h1]', array('default' => $loungeact->get_setting('font_family_h1'), 'type' => 'option'));
    $wp_customize->add_control(new Google_Font_Dropdown_Custom_Control($wp_customize, 'loungeact_font_family_h1', array('label' => esc_html__('H1 font family', 'loungeact'), 'section' => 'loungeact_typography', 'settings' => 'loungeact[font_family_h1]', 'priority' => 20)));
    $wp_customize->add_setting('loungeact[font_family_h2]', array('default' => $loungeact->get_setting('font_family_h2'), 'type' => 'option'));
    $wp_customize->add_control(new Google_Font_Dropdown_Custom_Control($wp_customize, 'loungeact_font_family_h2', array('label' => esc_html__('H2 font family', 'loungeact'), 'section' => 'loungeact_typography', 'settings' => 'loungeact[font_family_h2]', 'priority' => 30)));
    /*
     * ============== Menu ==============
     */
    $wp_customize->add_section('loungeact_menu_responsive_options', array('title' => esc_html__('Responsive options', 'loungeact'), 'panel' => 'nav_menus', 'priority' => 1));
    $wp_customize->add_setting('loungeact[menu_slide]', array('default' => $loungeact->get_setting('menu_slide'), 'type' => 'option'));
    $wp_customize->add_control('loungeact_menu_slide', array('label' => esc_html__('Menu slide', 'loungeact'), 'section' => 'loungeact_menu_responsive_options', 'settings' => 'loungeact[menu_slide]', 'type' => 'select', 'choices' => array('' => esc_html__('No', 'loungeact'), 'loungeact-menu-slide-left' => esc_html__('From the left', 'loungeact'), 'loungeact-menu-slide-right' => esc_html__('From the right', 'loungeact')), 'priority' => 10));
    $wp_customize->add_section('loungeact_menu_styles', array('title' => esc_html__('Styles', 'loungeact'), 'panel' => 'nav_menus', 'priority' => 2));
    $wp_customize->add_setting('loungeact[menu_font_color]', array('default' => $loungeact->get_setting('menu_font_color'), 'type' => 'option'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'loungeact_menu_font_color', array('label' => esc_html__('Font color', 'loungeact'), 'section' => 'loungeact_menu_styles', 'settings' => 'loungeact[menu_font_color]', 'priority' => 10)));
    $wp_customize->add_setting('loungeact[menu_font_color_hover]', array('default' => $loungeact->get_setting('menu_font_color'), 'type' => 'option'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'loungeact_menu_font_color_hover', array('label' => esc_html__('Font color on mouse over', 'loungeact'), 'section' => 'loungeact_menu_styles', 'settings' => 'loungeact[menu_font_color_hover]', 'priority' => 20)));
    /*
     * ============== HOMEPAGE FEATURES ==============
     */
    /*
     * ============== HOMEPAGE HIGHLIGHTS ==============
     */
    // Helper
}
Пример #27
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function parallax_one_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
    /********************************************************/
    /************** WP DEFAULT CONTROLS  ********************/
    /********************************************************/
    $wp_customize->remove_control('background_color');
    $wp_customize->get_section('background_image')->panel = 'panel_2';
    $wp_customize->get_section('colors')->panel = 'panel_2';
    /********************************************************/
    /********************* APPEARANCE  **********************/
    /********************************************************/
    $wp_customize->add_panel('panel_2', array('priority' => 30, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__('Appearance', 'parallax-one')));
    $wp_customize->add_setting('parallax_one_text_color', array('default' => '#313131', 'sanitize_callback' => 'parallax_one_sanitize_text'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'parallax_one_text_color', array('label' => esc_html__('Text color', 'parallax-one'), 'section' => 'colors', 'priority' => 5)));
    $wp_customize->add_setting('parallax_one_title_color', array('default' => '#454545', 'sanitize_callback' => 'parallax_one_sanitize_text'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'parallax_one_title_color', array('label' => esc_html__('Title color', 'parallax-one'), 'section' => 'colors', 'priority' => 6)));
    $wp_customize->add_section('parallax_one_appearance_general', array('title' => esc_html__('General options', 'parallax-one'), 'priority' => 3, 'description' => esc_html__('Paralax One theme general appearance options', 'parallax-one'), 'panel' => 'panel_2'));
    /* Logo	*/
    $wp_customize->add_setting('paralax_one_logo', array('default' => parallax_get_file('/images/logo-nav.png'), 'sanitize_callback' => 'esc_url', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'paralax_one_logo', array('label' => esc_html__('Logo', 'parallax-one'), 'section' => 'parallax_one_appearance_general', 'priority' => 1)));
    /* Sticky header */
    $wp_customize->add_setting('paralax_one_sticky_header', array('sanitize_callback' => 'parallax_one_sanitize_text'));
    $wp_customize->add_control('paralax_one_sticky_header', array('type' => 'checkbox', 'label' => esc_html__('Header visibility', 'parallax-one'), 'description' => esc_html__('If this box is checked, the header will toggle on frontpage.', 'parallax-one'), 'section' => 'parallax_one_appearance_general', 'priority' => 2));
    /********************************************************/
    /************* HEADER OPTIONS  ********************/
    /********************************************************/
    $wp_customize->add_panel('panel_1', array('priority' => 31, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => esc_html__('Header section', 'parallax-one')));
    /* HEADER CONTENT */
    $wp_customize->add_section('parallax_one_header_content', array('title' => esc_html__('Content', 'parallax-one'), 'priority' => 1, 'panel' => 'panel_1'));
    /* Header Logo	*/
    $wp_customize->add_setting('paralax_one_header_logo', array('default' => parallax_get_file('/images/logo-2.png'), 'sanitize_callback' => 'esc_url', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'paralax_one_header_logo', array('label' => esc_html__('Header Logo', 'parallax-one'), 'section' => 'parallax_one_header_content', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1)));
    /* Header title */
    $wp_customize->add_setting('parallax_one_header_title', array('default' => esc_html__('Simple, Reliable and Awesome.', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_header_title', array('label' => esc_html__('Main title', 'parallax-one'), 'section' => 'parallax_one_header_content', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 2));
    /* Header subtitle */
    $wp_customize->add_setting('parallax_one_header_subtitle', array('default' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_header_subtitle', array('label' => esc_html__('Subtitle', 'parallax-one'), 'section' => 'parallax_one_header_content', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 3));
    /*Header Button text*/
    $wp_customize->add_setting('parallax_one_header_button_text', array('default' => esc_html__('GET STARTED', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_header_button_text', array('label' => esc_html__('Button label', 'parallax-one'), 'section' => 'parallax_one_header_content', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 4));
    $wp_customize->add_setting('parallax_one_header_button_link', array('default' => esc_html__('#', 'parallax-one'), 'sanitize_callback' => 'esc_url', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_header_button_link', array('label' => esc_html__('Button link', 'parallax-one'), 'section' => 'parallax_one_header_content', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 5));
    /* LOGOS SETTINGS */
    $wp_customize->add_section('parallax_one_logos_settings_section', array('title' => esc_html__('Logos Bar', 'parallax-one'), 'priority' => 2, 'panel' => 'panel_1'));
    require_once 'class/parallax-one-general-control.php';
    $wp_customize->add_setting('parallax_one_logos_content', array('sanitize_callback' => 'parallax_one_sanitize_text', 'default' => json_encode(array(array("image_url" => parallax_get_file('/images/companies/7.png'), "link" => "#"), array("image_url" => parallax_get_file('/images/companies/9.png'), "link" => "#"), array("image_url" => parallax_get_file('/images/companies/8.png'), "link" => "#")))));
    $wp_customize->add_control(new Parallax_One_General_Repeater($wp_customize, 'parallax_one_logos_content', array('label' => esc_html__('Add new social icon', 'parallax-one'), 'section' => 'parallax_one_logos_settings_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1, 'parallax_image_control' => true, 'parallax_icon_control' => false, 'parallax_text_control' => false, 'parallax_link_control' => true)));
    $wp_customize->get_section('header_image')->panel = 'panel_1';
    /********************************************************/
    /****************** SERVICES OPTIONS  *******************/
    /********************************************************/
    /* SERVICES SECTION */
    $wp_customize->add_section('parallax_one_services_section', array('title' => esc_html__('Services section', 'parallax-one'), 'priority' => 32));
    /* Services title */
    $wp_customize->add_setting('parallax_one_our_services_title', array('default' => esc_html__('Our Services', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_our_services_title', array('label' => esc_html__('Main title', 'parallax-one'), 'section' => 'parallax_one_services_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1));
    /* Services subtitle */
    $wp_customize->add_setting('parallax_one_our_services_subtitle', array('default' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_our_services_subtitle', array('label' => esc_html__('Subtitle', 'parallax-one'), 'section' => 'parallax_one_services_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 2));
    /* Services content */
    $wp_customize->add_setting('parallax_one_services_content', array('sanitize_callback' => 'parallax_one_sanitize_text', 'default' => json_encode(array(array('choice' => 'parallax_icon', 'icon_value' => 'icon-basic-webpage-multiple', 'title' => esc_html__('Lorem Ipsum', 'parallax-one'), 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo.', 'parallax-one')), array('choice' => 'parallax_icon', 'icon_value' => 'icon-ecommerce-graph3', 'title' => esc_html__('Lorem Ipsum', 'parallax-one'), 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo.', 'parallax-one')), array('choice' => 'parallax_icon', 'icon_value' => 'icon-basic-geolocalize-05', 'title' => esc_html__('Lorem Ipsum', 'parallax-one'), 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo.', 'parallax-one'))))));
    $wp_customize->add_control(new Parallax_One_General_Repeater($wp_customize, 'parallax_one_services_content', array('label' => esc_html__('Add new service box', 'parallax-one'), 'section' => 'parallax_one_services_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 3, 'parallax_image_control' => true, 'parallax_icon_control' => true, 'parallax_title_control' => true, 'parallax_text_control' => true)));
    /********************************************************/
    /******************** ABOUT OPTIONS  ********************/
    /********************************************************/
    $wp_customize->add_section('parallax_one_about_section', array('title' => esc_html__('About section', 'parallax-one'), 'priority' => 33));
    /* About title */
    $wp_customize->add_setting('parallax_one_our_story_title', array('default' => esc_html__('Our Story', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_our_story_title', array('label' => esc_html__('Main title', 'parallax-one'), 'section' => 'parallax_one_about_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1));
    /* About Content */
    $wp_customize->add_setting('parallax_one_our_story_text', array('default' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_html', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_our_story_text', array('type' => 'textarea', 'label' => esc_html__('Content', 'parallax-one'), 'section' => 'parallax_one_about_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 2));
    /* About Image	*/
    $wp_customize->add_setting('paralax_one_our_story_image', array('default' => parallax_get_file('/images/about-us.png'), 'sanitize_callback' => 'esc_url', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'paralax_one_our_story_image', array('label' => esc_html__('Image', 'parallax-one'), 'section' => 'parallax_one_about_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 3)));
    /********************************************************/
    /*******************  TEAM OPTIONS  *********************/
    /********************************************************/
    $wp_customize->add_section('parallax_one_team_section', array('title' => esc_html__('Team section', 'parallax-one'), 'priority' => 34));
    /* Team title */
    $wp_customize->add_setting('parallax_one_our_team_title', array('default' => esc_html__('Our Team', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_our_team_title', array('label' => esc_html__('Main title', 'parallax-one'), 'section' => 'parallax_one_team_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1));
    /* Team subtitle */
    $wp_customize->add_setting('parallax_one_our_team_subtitle', array('default' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_our_team_subtitle', array('label' => esc_html__('Subtitle', 'parallax-one'), 'section' => 'parallax_one_team_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 2));
    /* Team content */
    $wp_customize->add_setting('parallax_one_team_content', array('sanitize_callback' => 'parallax_one_sanitize_text', 'default' => json_encode(array(array('image_url' => parallax_get_file('/images/team/1.jpg'), 'title' => esc_html__('Albert Jacobs', 'parallax-one'), 'subtitle' => esc_html__('Founder & CEO', 'parallax-one')), array('image_url' => parallax_get_file('/images/team/2.jpg'), 'title' => esc_html__('Tonya Garcia', 'parallax-one'), 'subtitle' => esc_html__('Account Manager', 'parallax-one')), array('image_url' => parallax_get_file('/images/team/3.jpg'), 'title' => esc_html__('Linda Guthrie', 'parallax-one'), 'subtitle' => esc_html__('Business Development', 'parallax-one'))))));
    $wp_customize->add_control(new Parallax_One_General_Repeater($wp_customize, 'parallax_one_team_content', array('label' => esc_html__('Add new team member', 'parallax-one'), 'section' => 'parallax_one_team_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 3, 'parallax_image_control' => true, 'parallax_title_control' => true, 'parallax_subtitle_control' => true)));
    /********************************************************/
    /********** TESTIMONIALS OPTIONS  ***********************/
    /********************************************************/
    $wp_customize->add_section('parallax_one_testimonials_section', array('title' => esc_html__('Testimonial section', 'parallax-one'), 'priority' => 35));
    /* Testimonials title */
    $wp_customize->add_setting('parallax_one_happy_customers_title', array('default' => esc_html__('Happy Customers', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_happy_customers_title', array('label' => esc_html__('Main title', 'parallax-one'), 'section' => 'parallax_one_testimonials_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1));
    /* Testimonials subtitle */
    $wp_customize->add_setting('parallax_one_happy_customers_subtitle', array('default' => esc_html__('Cloud computing subscription model out of the box proactive solution.', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_happy_customers_subtitle', array('label' => esc_html__('Subtitle', 'parallax-one'), 'section' => 'parallax_one_testimonials_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 2));
    /* Testimonials content */
    $wp_customize->add_setting('parallax_one_testimonials_content', array('sanitize_callback' => 'parallax_one_sanitize_text', 'default' => json_encode(array(array('image_url' => parallax_get_file('/images/clients/1.jpg'), 'title' => esc_html__('Happy Customer', 'parallax-one'), 'subtitle' => esc_html__('Lorem ipsum', 'parallax-one'), 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo. Fusce malesuada vulputate faucibus. Integer in hendrerit nisi. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet.', 'parallax-one')), array('image_url' => parallax_get_file('/images/clients/2.jpg'), 'title' => esc_html__('Happy Customer', 'parallax-one'), 'subtitle' => esc_html__('Lorem ipsum', 'parallax-one'), 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo. Fusce malesuada vulputate faucibus. Integer in hendrerit nisi. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet.', 'parallax-one')), array('image_url' => parallax_get_file('/images/clients/3.jpg'), 'title' => esc_html__('Happy Customer', 'parallax-one'), 'subtitle' => esc_html__('Lorem ipsum', 'parallax-one'), 'text' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh. Etiam non elit dui. Nullam vel eros sit amet arcu vestibulum accumsan in in leo. Fusce malesuada vulputate faucibus. Integer in hendrerit nisi. Praesent a hendrerit urna. In non imperdiet elit, sed molestie odio. Fusce ac metus non purus sollicitudin laoreet.', 'parallax-one'))))));
    $wp_customize->add_control(new Parallax_One_General_Repeater($wp_customize, 'parallax_one_testimonials_content', array('label' => esc_html__('Add new testimonial', 'parallax-one'), 'section' => 'parallax_one_testimonials_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 3, 'parallax_image_control' => true, 'parallax_title_control' => true, 'parallax_subtitle_control' => true, 'parallax_text_control' => true)));
    /********************************************************/
    /***************** RIBBON OPTIONS  *****************/
    /********************************************************/
    /* RIBBON SETTINGS */
    $wp_customize->add_section('parallax_one_ribbon_section', array('title' => esc_html__('Ribbon section', 'parallax-one'), 'priority' => 36));
    /* Ribbon Background	*/
    $wp_customize->add_setting('paralax_one_ribbon_background', array('default' => parallax_get_file('/images/background-images/parallax-img/parallax-img1.jpg'), 'sanitize_callback' => 'esc_url', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'paralax_one_ribbon_background', array('label' => esc_html__('Ribbon Background', 'parallax-one'), 'section' => 'parallax_one_ribbon_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1)));
    $wp_customize->add_setting('parallax_one_ribbon_title', array('default' => esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_ribbon_title', array('label' => esc_html__('Main title', 'parallax-one'), 'section' => 'parallax_one_ribbon_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 2));
    $wp_customize->add_setting('parallax_one_button_text', array('default' => esc_html__('GET STARTED', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_button_text', array('label' => esc_html__('Button label', 'parallax-one'), 'section' => 'parallax_one_ribbon_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 3));
    $wp_customize->add_setting('parallax_one_button_link', array('default' => esc_html__('#', 'parallax-one'), 'sanitize_callback' => 'esc_url', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_button_link', array('label' => esc_html__('Button link', 'parallax-one'), 'section' => 'parallax_one_ribbon_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 4));
    /********************************************************/
    /************ LATEST NEWS OPTIONS  **************/
    /********************************************************/
    $wp_customize->add_section('parallax_one_latest_news_section', array('title' => esc_html__('Latest news section', 'parallax-one'), 'priority' => 36));
    $wp_customize->add_setting('parallax_one_latest_news_title', array('default' => esc_html__('Latest news', 'parallax-one'), 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_latest_news_title', array('label' => esc_html__('Main title', 'parallax-one'), 'section' => 'parallax_one_latest_news_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1));
    /********************************************************/
    /****************** CONTACT OPTIONS  ********************/
    /********************************************************/
    /* CONTACT SETTINGS */
    $wp_customize->add_section('parallax_one_contact_section', array('title' => esc_html__('Contact section', 'parallax-one'), 'priority' => 37));
    $wp_customize->add_setting('parallax_one_contact_info_content', array('sanitize_callback' => 'parallax_one_sanitize_text', 'default' => json_encode(array(array("icon_value" => "icon-basic-mail", "text" => "*****@*****.**", "link" => "#"), array("icon_value" => "icon-basic-geolocalize-01", "text" => "Company address", "link" => "#"), array("icon_value" => "icon-basic-tablet", "text" => "0 332 548 954", "link" => "#")))));
    $wp_customize->add_control(new Parallax_One_General_Repeater($wp_customize, 'parallax_one_contact_info_content', array('label' => esc_html__('Add new contact field', 'parallax-one'), 'section' => 'parallax_one_contact_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 1, 'parallax_image_control' => false, 'parallax_icon_control' => true, 'parallax_text_control' => true, 'parallax_link_control' => true)));
    /* Map ShortCode  */
    $wp_customize->add_setting('parallax_one_frontpage_map_shortcode', array('default' => '', 'sanitize_callback' => 'parallax_one_sanitize_text'));
    $wp_customize->add_control('parallax_one_frontpage_map_shortcode', array('label' => esc_html__('Map shortcode', 'parallax-one'), 'description' => __('To use this section please install <a href="https://wordpress.org/plugins/intergeo-maps/">Intergeo Maps</a> plugin then use it to create a map and paste here the shortcode generated', 'parallax-one'), 'section' => 'parallax_one_contact_section', 'active_callback' => 'parallax_one_show_on_front', 'priority' => 2));
    /********************************************************/
    /*************** CONTACT PAGE OPTIONS  ******************/
    /********************************************************/
    $wp_customize->add_section('parallax_one_contact_page', array('title' => esc_html__('Contact page', 'parallax-one'), 'priority' => 39));
    /* Contact Form  */
    $wp_customize->add_setting('parallax_one_contact_form_shortcode', array('default' => '', 'sanitize_callback' => 'parallax_one_sanitize_text'));
    $wp_customize->add_control('parallax_one_contact_form_shortcode', array('label' => esc_html__('Contact form shortcode', 'parallax-one'), 'description' => __('Create a form, copy the shortcode generated and paste it here. We recommend <a href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a> but you can use any plugin you like.', 'parallax-one'), 'section' => 'parallax_one_contact_page', 'active_callback' => 'parallax_one_is_contact_page', 'priority' => 1));
    /* Map ShortCode  */
    $wp_customize->add_setting('parallax_one_contact_map_shortcode', array('default' => '', 'sanitize_callback' => 'parallax_one_sanitize_text'));
    $wp_customize->add_control('parallax_one_contact_map_shortcode', array('label' => esc_html__('Map shortcode', 'parallax-one'), 'description' => __('To use this section please install <a href="https://wordpress.org/plugins/intergeo-maps/">Intergeo Maps</a> plugin then use it to create a map and paste here the shortcode generated', 'parallax-one'), 'section' => 'parallax_one_contact_page', 'active_callback' => 'parallax_one_is_contact_page', 'priority' => 2));
    /********************************************************/
    /****************** FOOTER OPTIONS  *********************/
    /********************************************************/
    $wp_customize->add_section('parallax_one_footer_section', array('title' => esc_html__('Footer options', 'parallax-one'), 'priority' => 39, 'description' => esc_html__('The main content of this section is customizable in: Customize -> Widgets -> Footer area. ', 'parallax-one')));
    /* Footer Menu */
    $nav_menu_locations_footer = $wp_customize->get_control('nav_menu_locations[parallax_footer_menu]');
    if (!empty($nav_menu_locations_footer)) {
        $nav_menu_locations_footer->section = 'parallax_one_footer_section';
        $nav_menu_locations_footer->priority = 1;
    }
    /* Copyright */
    $wp_customize->add_setting('parallax_one_copyright', array('default' => 'Themeisle', 'sanitize_callback' => 'parallax_one_sanitize_text', 'transport' => 'postMessage'));
    $wp_customize->add_control('parallax_one_copyright', array('label' => esc_html__('Copyright', 'parallax-one'), 'section' => 'parallax_one_footer_section', 'priority' => 2));
    /* Socials icons */
    $wp_customize->add_setting('parallax_one_social_icons', array('sanitize_callback' => 'parallax_one_sanitize_text', 'default' => json_encode(array(array('icon_value' => 'icon-social-facebook', 'link' => '#'), array('icon_value' => 'icon-social-twitter', 'link' => '#'), array('icon_value' => 'icon-social-googleplus', 'link' => '#')))));
    $wp_customize->add_control(new Parallax_One_General_Repeater($wp_customize, 'parallax_one_social_icons', array('label' => esc_html__('Add new social icon', 'parallax-one'), 'section' => 'parallax_one_footer_section', 'priority' => 3, 'parallax_image_control' => false, 'parallax_icon_control' => true, 'parallax_text_control' => false, 'parallax_link_control' => true)));
    /********************************************************/
    /************** ADVANCED OPTIONS  ***********************/
    /********************************************************/
    $wp_customize->add_section('parallax_one_general_section', array('title' => esc_html__('Advanced options', 'parallax-one'), 'priority' => 40, 'description' => esc_html__('Paralax One theme general options', 'parallax-one')));
    $blogname = $wp_customize->get_control('blogname');
    $blogdescription = $wp_customize->get_control('blogdescription');
    $show_on_front = $wp_customize->get_control('show_on_front');
    $page_on_front = $wp_customize->get_control('page_on_front');
    $page_for_posts = $wp_customize->get_control('page_for_posts');
    if (!empty($blogname)) {
        $blogname->section = 'parallax_one_general_section';
        $blogname->priority = 1;
    }
    if (!empty($blogdescription)) {
        $blogdescription->section = 'parallax_one_general_section';
        $blogdescription->priority = 2;
    }
    if (!empty($show_on_front)) {
        $show_on_front->section = 'parallax_one_general_section';
        $show_on_front->priority = 3;
    }
    if (!empty($page_on_front)) {
        $page_on_front->section = 'parallax_one_general_section';
        $page_on_front->priority = 4;
    }
    if (!empty($page_for_posts)) {
        $page_for_posts->section = 'parallax_one_general_section';
        $page_for_posts->priority = 5;
    }
    $wp_customize->remove_section('static_front_page');
    $wp_customize->remove_section('title_tagline');
    $nav_menu_locations_primary = $wp_customize->get_control('nav_menu_locations[primary]');
    if (!empty($nav_menu_locations_primary)) {
        $nav_menu_locations_primary->section = 'parallax_one_general_section';
        $nav_menu_locations_primary->priority = 6;
    }
    /* Disable preloader */
    $wp_customize->add_setting('paralax_one_disable_preloader', array('sanitize_callback' => 'parallax_one_sanitize_text'));
    $wp_customize->add_control('paralax_one_disable_preloader', array('type' => 'checkbox', 'label' => esc_html__('Disable preloader?', 'parallax-one'), 'description' => esc_html__('If this box is checked, the preloader will be disabled from homepage.', 'parallax-one'), 'section' => 'parallax_one_general_section', 'priority' => 7));
}
Пример #28
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function semifolio_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    /**
    * Remove setting & control
    */
    $wp_customize->remove_setting('display_header_text');
    $wp_customize->remove_control('display_header_text');
    $wp_customize->remove_section('color');
    $wp_customize->remove_setting('header_textcolor');
    $wp_customize->remove_control('header_textcolor');
    /**
     * Textarea customize control class.
     */
    if (class_exists('WP_Customize_Control')) {
        class Semifolio_Customize_Textarea_Control extends WP_Customize_Control
        {
            public $type = 'textarea';
            public function render_content()
            {
                ?>
        <label>
            <span class="customize-control-title"><?php 
                echo esc_html($this->label);
                ?>
</span>
                <textarea rows= "5" style="width:100%;"<?php 
                $this->link();
                ?>
><?php 
                echo esc_textarea($this->value());
                ?>
</textarea>
        </label>
        <?php 
            }
        }
    }
    /**
     * Text attribute customize control class.
     */
    if (class_exists('WP_Customize_Control')) {
        class Semifolio_Customize_Info_Control extends WP_Customize_Control
        {
            public $type = 'info';
            public function render_content()
            {
                ?>
        <label>
            <span class="customize-control-title"><?php 
                echo esc_html($this->label);
                ?>
</span>
            <span <?php 
                $this->link();
                ?>
><?php 
                echo esc_attr($this->value());
                ?>
</span>
        </label>
    <?php 
            }
        }
    }
    /*----------------------------------------------------------------------------------------*/
    /* Blog Options. 
    /*----------------------------------------------------------------------------------------*/
    $wp_customize->add_section('semifolio_blog_options', array('title' => __('Blog Options', 'semifolio'), 'description' => '', 'priority' => 1));
    // Display Popular Post
    $wp_customize->add_setting('semifolio_display_popular_post_setting', array('default' => 0, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_checkbox'));
    $wp_customize->add_control('popular_post', array('label' => __('Do You want to display popular post?', 'semifolio'), 'section' => 'semifolio_blog_options', 'settings' => 'semifolio_display_popular_post_setting', 'type' => 'checkbox', 'priority' => 1));
    // Display Slideshow
    $wp_customize->add_setting('semifolio_display_portfolio_setting', array('default' => 0, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_checkbox'));
    $wp_customize->add_control('portfolio_post', array('settings' => 'semifolio_display_portfolio_setting', 'label' => __('Do You want to display portfolio post?', 'semifolio'), 'section' => 'semifolio_blog_options', 'type' => 'checkbox', 'priority' => 2));
    // Post Type Portfolio
    $wp_customize->add_setting('semifolio_posttype_portfolio', array('default' => 'page', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_text_attribute'));
    $wp_customize->add_control(new Semifolio_Customize_Textarea_Control($wp_customize, 'posttype_portfolio', array('label' => __('Input post type just for custom post portfolio, separated by commas if use more than one of post type. This support post type from plugin installed. Example: ( default blog: "post", "page" )', 'semifolio'), 'section' => 'semifolio_blog_options', 'settings' => 'semifolio_posttype_portfolio', 'type' => 'textarea', 'priority' => 3)));
    /*----------------------------------------------------------------------------------------*/
    /* Layout Options Section 
    /*----------------------------------------------------------------------------------------*/
    $wp_customize->add_section('semifolio_layout_options', array('title' => __('Layout Options', 'semifolio'), 'description' => '', 'priority' => 2));
    // Display Favicon
    $wp_customize->add_setting('semifolio_display_favicon_icon', array('default' => 0, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_checkbox'));
    $wp_customize->add_control('display_favicon_icon', array('settings' => 'semifolio_display_favicon_icon', 'label' => __('Do you want to display favicon?', 'semifolio'), 'section' => 'semifolio_layout_options', 'type' => 'checkbox', 'priority' => 1));
    // Upload Favicon Icon
    $wp_customize->add_setting('semifolio_upload_favicon_icon', array('capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'upload_favicon_icon', array('label' => __('Upload Favicon:', 'semifolio'), 'section' => 'semifolio_layout_options', 'settings' => 'semifolio_upload_favicon_icon', 'priority' => 2)));
    // Upload Header Ads Image
    $wp_customize->add_setting('semifolio_upload_header_ads', array('capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'upload_header_ads', array('label' => __('Upload Header Ads Image:', 'semifolio'), 'section' => 'semifolio_layout_options', 'settings' => 'semifolio_upload_header_ads', 'priority' => 3)));
    // Header Ads URL
    $wp_customize->add_setting('semifolio_header_ads_url', array('default' => '', 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_text_attribute'));
    $wp_customize->add_control(new Semifolio_Customize_Textarea_Control($wp_customize, 'header_ads_url', array('label' => __('Input Full URL Header Ads', 'semifolio'), 'section' => 'semifolio_layout_options', 'settings' => 'semifolio_header_ads_url', 'type' => 'textarea', 'priority' => 4)));
    // Display Footer Widget
    $wp_customize->add_setting('semifolio_display_footer_widget', array('default' => 0, 'capability' => 'edit_theme_options', 'type' => 'option', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_checkbox'));
    $wp_customize->add_control('display_footer_widget', array('settings' => 'semifolio_display_footer_widget', 'label' => __('Do You want to display Footer Widget?', 'semifolio'), 'section' => 'semifolio_layout_options', 'type' => 'checkbox', 'priority' => 5));
    // Footer Tagline
    $wp_customize->add_setting('semifolio_footer_tagline', array('default' => '' . __('Change the tagline about your site, which will display on the bottom section of the footer. This section supports html tags if desired. The text is wrapped in a paragraph element for formatting. <a href="' . esc_url(__('http://generasite.tk/', 'semifolio')) . '">Upgrade Now!</a>', 'semifolio') . '', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_text_attribute'));
    $wp_customize->add_control(new Semifolio_Customize_Info_Control($wp_customize, 'footer_tagline', array('label' => __('Footer Bottom Tagline', 'semifolio'), 'section' => 'semifolio_layout_options', 'settings' => 'semifolio_footer_tagline', 'type' => 'info', 'priority' => 6)));
    /*----------------------------------------------------------------------------------------*/
    /* Images Resize Section 
    /*----------------------------------------------------------------------------------------*/
    $wp_customize->add_section('semifolio_images_resize_section', array('title' => __('Images Resize', 'semifolio'), 'description' => 'Semifolio PRO Support Only!', 'priority' => 3));
    // PRO Options
    $wp_customize->add_setting('semifolio_images_resize', array('default' => '' . __('Allows you to change the size of images in posts on every page of your blog. <a href="' . esc_url(__('http://generasite.tk/', 'semifolio')) . '">Upgrade Now!</a>', 'semifolio') . '', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_text_attribute'));
    $wp_customize->add_control(new Semifolio_Customize_Info_Control($wp_customize, 'images_resize', array('label' => __('Semifolio PRO Options!', 'semifolio'), 'section' => 'semifolio_images_resize_section', 'settings' => 'semifolio_images_resize', 'type' => 'info')));
    /*----------------------------------------------------------------------------------------*/
    /* Background Color Section 
    /*----------------------------------------------------------------------------------------*/
    $wp_customize->add_section('semifolio_background_color_section', array('title' => __('Background Color', 'semifolio'), 'description' => 'Semifolio PRO Support Only!', 'priority' => 4));
    // PRO Options
    $wp_customize->add_setting('semifolio_background_color', array('default' => '' . __('Allows you to change the background in each area on your blog page. <a href="' . esc_url(__('http://generasite.tk/', 'semifolio')) . '">Upgrade Now!</a>', 'semifolio') . '', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_text_attribute'));
    $wp_customize->add_control(new Semifolio_Customize_Info_Control($wp_customize, 'background_color', array('label' => __('Semifolio PRO Options!', 'semifolio'), 'section' => 'semifolio_background_color_section', 'settings' => 'semifolio_background_color', 'type' => 'info')));
    /*----------------------------------------------------------------------------------------*/
    /* Text & Links Color Section
    /*----------------------------------------------------------------------------------------*/
    $wp_customize->add_section('semifolio_text_color_section', array('title' => __('Texts & Links Color', 'semifolio'), 'description' => 'Semifolio PRO Support Only!', 'priority' => 5));
    // PRO Options
    $wp_customize->add_setting('semifolio_text_color', array('default' => '' . __('With this option, you can change the color of text and links in almost all parts of the area of the blog, or align with the background that you change. <a href="' . esc_url(__('http://generasite.tk/', 'semifolio')) . '">Upgrade Now!</a>', 'semifolio') . '', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_text_attribute'));
    $wp_customize->add_control(new Semifolio_Customize_Info_Control($wp_customize, 'text_color', array('label' => __('Semifolio PRO Options!', 'semifolio'), 'section' => 'semifolio_text_color_section', 'settings' => 'semifolio_text_color', 'type' => 'info')));
    /*----------------------------------------------------------------------------------------*/
    /* Tracking Code, Script & CSS Section
    /*----------------------------------------------------------------------------------------*/
    $wp_customize->add_section('semifolio_code_section', array('title' => __('Tracking Code, Script & CSS', 'semifolio'), 'description' => 'Semifolio PRO Support Only!', 'priority' => 6));
    // PRO Options
    $wp_customize->add_setting('semifolio_tracking_code', array('default' => '' . __('Add your site in Google Webmaster by attaching a tracking code, analitycs, and tagmanager. You can also add code your own scripts and css, that will added into header and footer. <a href="' . esc_url(__('http://generasite.tk/', 'semifolio')) . '">Upgrade Now!</a>', 'semifolio') . '', 'transport' => 'postMessage', 'sanitize_callback' => 'semifolio_sanitize_text_attribute'));
    $wp_customize->add_control(new Semifolio_Customize_Info_Control($wp_customize, 'tracking_code', array('label' => __('Semifolio PRO Options!', 'semifolio'), 'section' => 'semifolio_code_section', 'settings' => 'semifolio_tracking_code', 'type' => 'info')));
}
Пример #29
0
/**
 * @param \WP_Customize_Manager $wp_customize
 *
 * @see http://codex.wordpress.org/Plugin_API/Action_Reference/customize_register
 */
function customize_register($wp_customize)
{
    $wp_customize->remove_section('static_front_page');
}
Пример #30
0
/**
 * Briar Theme custom options
 *
 * @since 1.0
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function briar_customize_register($wp_customize)
{
    /**
     * Customizer additions.
     */
    require get_template_directory() . '/inc/customizer-functions.php';
    // Extra functions.
    require get_template_directory() . '/inc/customizer-controls.php';
    // Extra controls.
    // Remove Site title & tagline section.
    $wp_customize->remove_section('title_tagline');
    // Change site title and tagline controls transport to postMessage.
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    // Move site title and tagline controls to header section.
    $wp_customize->get_control('blogname')->section = 'header';
    $wp_customize->get_control('blogdescription')->section = 'header';
    // Remove preexisting controls.
    $wp_customize->remove_control('header_textcolor');
    /* -------		Header 		------- */
    $wp_customize->add_section('header', array('title' => __('Header', 'briar'), 'priority' => 29));
    $sanitize_header_choice = new Briar_Sanitize_Select(array('logo', 'title'), 'title');
    $wp_customize->add_setting('briar_header', array('default' => 'title', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_header_choice, 'callback')));
    $wp_customize->add_control('briar_header', array('label' => __('Display', 'briar'), 'section' => 'header', 'type' => 'select', 'choices' => array('logo' => __('Logo', 'briar'), 'title' => __('Site Title', 'briar'))));
    $wp_customize->add_setting('briar_header_logo', array('default' => get_template_directory_uri() . '/img/themejack.png', 'transport' => 'postMessage', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'briar_header_logo', array('label' => __('Upload a logo', 'briar'), 'section' => 'header')));
    $sections = $wp_customize->sections();
    /* -------		Colors 			------- */
    if (!isset($sections['colors'])) {
        $wp_customize->add_section('colors', array('title' => __('Colors', 'briar'), 'priority' => 40));
    }
    $wp_customize->add_setting('briar_custom_style', array('default' => '', 'transport' => 'postMessage', 'sanitize_callback' => 'briar_sanitize_text_trim'));
    $sanitize_scheme = new Briar_Sanitize_Select(array('custom', 'red', 'orange', 'yellow', 'blue', 'violet', 'green'), 'red');
    $wp_customize->add_setting('briar_scheme', array('default' => 'red', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_scheme, 'callback')));
    $wp_customize->add_control(new Briar_Color_Scheme_Control($wp_customize, 'briar_scheme', array('label' => __('Color Scheme', 'briar'), 'schemes' => array('red' => array('label' => __('Red', 'briar'), 'color' => '#f15156', 'colors' => array('briar_anchor_color' => '#f15156', 'briar_header_color' => '#f15156', 'briar_logo_color' => '#f15156', 'briar_menu_color' => '#f15156', 'briar_footer_color' => '#f15156', 'briar_readmore_color' => '#f15156', 'briar_comments_button_color' => '#f15156', 'briar_comments_submit_button_color' => '#f15156', 'briar_title_hover_color' => '#f15156', 'briar_prev_next_posts_color' => '#f15156', 'briar_search_button_color' => '#f15156', 'briar_audio_color' => '#f15156', 'briar_gallery_arrows_color' => '#f15156', 'briar_blog_post_pagination_color' => '#f15156', 'briar_password_protected_button_color' => '#f15156')), 'orange' => array('label' => __('Orange', 'briar'), 'color' => '#e8813d', 'colors' => array('briar_anchor_color' => '#e8813d', 'briar_header_color' => '#e8813d', 'briar_logo_color' => '#e8813d', 'briar_menu_color' => '#e8813d', 'briar_footer_color' => '#e8813d', 'briar_readmore_color' => '#e8813d', 'briar_comments_button_color' => '#e8813d', 'briar_comments_submit_button_color' => '#e8813d', 'briar_title_hover_color' => '#e8813d', 'briar_prev_next_posts_color' => '#e8813d', 'briar_search_button_color' => '#e8813d', 'briar_audio_color' => '#e8813d', 'briar_gallery_arrows_color' => '#e8813d', 'briar_blog_post_pagination_color' => '#e8813d', 'briar_password_protected_button_color' => '#e8813d')), 'yellow' => array('label' => __('Yellow', 'briar'), 'color' => '#f5d13d', 'colors' => array('briar_anchor_color' => '#f5d13d', 'briar_header_color' => '#f5d13d', 'briar_logo_color' => '#f5d13d', 'briar_menu_color' => '#f5d13d', 'briar_footer_color' => '#f5d13d', 'briar_readmore_color' => '#f5d13d', 'briar_comments_button_color' => '#f5d13d', 'briar_comments_submit_button_color' => '#f5d13d', 'briar_title_hover_color' => '#f5d13d', 'briar_prev_next_posts_color' => '#f5d13d', 'briar_search_button_color' => '#f5d13d', 'briar_audio_color' => '#f5d13d', 'briar_gallery_arrows_color' => '#f5d13d', 'briar_blog_post_pagination_color' => '#f5d13d', 'briar_password_protected_button_color' => '#f5d13d')), 'blue' => array('label' => __('Blue', 'briar'), 'color' => '#2980b9', 'colors' => array('briar_anchor_color' => '#2980b9', 'briar_header_color' => '#2980b9', 'briar_logo_color' => '#2980b9', 'briar_menu_color' => '#2980b9', 'briar_footer_color' => '#2980b9', 'briar_readmore_color' => '#2980b9', 'briar_comments_button_color' => '#2980b9', 'briar_comments_submit_button_color' => '#2980b9', 'briar_title_hover_color' => '#2980b9', 'briar_prev_next_posts_color' => '#2980b9', 'briar_search_button_color' => '#2980b9', 'briar_audio_color' => '#2980b9', 'briar_gallery_arrows_color' => '#2980b9', 'briar_blog_post_pagination_color' => '#2980b9', 'briar_password_protected_button_color' => '#2980b9')), 'violet' => array('label' => __('Violet', 'briar'), 'color' => '#b365d3', 'colors' => array('briar_anchor_color' => '#b365d3', 'briar_header_color' => '#b365d3', 'briar_logo_color' => '#b365d3', 'briar_menu_color' => '#b365d3', 'briar_footer_color' => '#b365d3', 'briar_readmore_color' => '#b365d3', 'briar_comments_button_color' => '#b365d3', 'briar_comments_submit_button_color' => '#b365d3', 'briar_title_hover_color' => '#b365d3', 'briar_prev_next_posts_color' => '#b365d3', 'briar_search_button_color' => '#b365d3', 'briar_audio_color' => '#b365d3', 'briar_gallery_arrows_color' => '#b365d3', 'briar_blog_post_pagination_color' => '#b365d3', 'briar_password_protected_button_color' => '#b365d3')), 'green' => array('label' => __('Green', 'briar'), 'color' => '#27ae60', 'colors' => array('briar_anchor_color' => '#27ae60', 'briar_header_color' => '#27ae60', 'briar_logo_color' => '#27ae60', 'briar_menu_color' => '#27ae60', 'briar_footer_color' => '#27ae60', 'briar_readmore_color' => '#27ae60', 'briar_comments_button_color' => '#27ae60', 'briar_comments_submit_button_color' => '#27ae60', 'briar_title_hover_color' => '#27ae60', 'briar_prev_next_posts_color' => '#27ae60', 'briar_search_button_color' => '#27ae60', 'briar_audio_color' => '#27ae60', 'briar_gallery_arrows_color' => '#27ae60', 'briar_blog_post_pagination_color' => '#27ae60', 'briar_password_protected_button_color' => '#27ae60'))), 'section' => 'colors')));
    $wp_customize->add_setting('briar_anchor_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_anchor_color', array('label' => __('Anchor', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_header_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_header_color', array('label' => __('Header', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_logo_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_logo_color', array('label' => __('Logo', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_menu_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_menu_color', array('label' => __('Menu', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_footer_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_footer_color', array('label' => __('Footer', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_readmore_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_readmore_color', array('label' => __('Read more', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_comments_button_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_comments_button_color', array('label' => __('Comments button', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_comments_submit_button_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_comments_submit_button_color', array('label' => __('Comments submit', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_title_hover_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_title_hover_color', array('label' => __('Comments submit', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_prev_next_posts_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_prev_next_posts_color', array('label' => __('Older/Newer posts', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_search_button_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_search_button_color', array('label' => __('Search button', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_audio_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_audio_color', array('label' => __('Audio', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_gallery_arrows_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_gallery_arrows_color', array('label' => __('Gallery arrows', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_blog_post_pagination_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_blog_post_pagination_color', array('label' => __('Post pagination', 'briar'), 'section' => 'colors')));
    $wp_customize->add_setting('briar_password_protected_button_color', array('default' => '#f15156', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'briar_password_protected_button_color', array('label' => __('Password protected button', 'briar'), 'section' => 'colors')));
    /* -------		Layouts 		------- */
    $wp_customize->add_section('layouts', array('title' => __('Layouts', 'briar'), 'priority' => 40));
    $sanitize_global_layouts = new Briar_Sanitize_Select(array('none', 'left', 'right'), 'left');
    $sanitize_layouts = new Briar_Sanitize_Select(array('disabled', 'none', 'left', 'right'), 'disabled');
    $wp_customize->add_setting('briar_global_layout', array('default' => 'left', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_global_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_global_layout', array('label' => __('Global', 'briar'), 'section' => 'layouts', 'layouts' => array('none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 1)));
    $wp_customize->add_setting('briar_home_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_home_layout', array('label' => __('Home', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 2)));
    $wp_customize->add_setting('briar_blog_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_blog_layout', array('label' => __('Blog', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 3)));
    $wp_customize->add_setting('briar_single_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_single_layout', array('label' => __('Single', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 4)));
    $wp_customize->add_setting('briar_archive_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_archive_layout', array('label' => __('Archive', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 5)));
    $wp_customize->add_setting('briar_category_archive_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_category_archive_layout', array('label' => __('Category archive', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 6)));
    $wp_customize->add_setting('briar_search_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_search_layout', array('label' => __('Search', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 7)));
    $wp_customize->add_setting('briar_404_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_404_layout', array('label' => __('404', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 8)));
    $wp_customize->add_setting('briar_page_layout', array('default' => 'disabled', 'transport' => 'postMessage', 'sanitize_callback' => array($sanitize_layouts, 'callback')));
    $wp_customize->add_control(new Briar_Layout_Control($wp_customize, 'briar_page_layout', array('label' => __('Default Page', 'briar'), 'section' => 'layouts', 'layouts' => array('disabled' => array('label' => __('Disabled', 'briar')), 'none' => array('label' => __('None', 'briar')), 'left' => array('label' => __('Left', 'briar')), 'right' => array('label' => __('Right', 'briar'))), 'priority' => 9)));
    /* -------		Background 		------- */
    $wp_customize->get_control('background_color')->section = 'background_image';
    $wp_customize->get_section('background_image')->title = __('Background', 'briar');
    /* -------		Header 		------- */
    $wp_customize->add_section('footer', array('title' => __('Footer', 'briar'), 'priority' => 29));
    $wp_customize->add_setting('briar_footer_social_buttons', array('default' => array(array('social' => 'facebook', 'css_class' => 'facebook', 'url' => '#'), array('social' => 'twitter', 'css_class' => 'twitter', 'url' => '#'), array('social' => 'linkedin', 'css_class' => 'linkedin', 'url' => '#')), 'transport' => 'postMessage', 'sanitize_callback' => 'briar_sanitize_social_buttons'));
    $wp_customize->add_control(new Briar_Social_Buttons_Control($wp_customize, 'briar_footer_social_buttons', array('label' => __('Social buttons', 'briar'), 'socials' => array('facebook' => array('label' => __('Facebook', 'briar')), 'twitter' => array('label' => __('Twitter', 'briar')), 'linkedin' => array('label' => __('LinkedIn', 'briar')), 'dribbble' => array('label' => __('Dribbble', 'briar')), 'flickr' => array('label' => __('Flickr', 'briar')), 'github' => array('label' => __('GitHub', 'briar')), 'googleplus' => array('label' => __('Google+', 'briar')), 'instagram' => array('label' => __('Instagram', 'briar')), 'pinterest' => array('label' => __('Pinterest', 'briar')), 'stumbleupon' => array('label' => __('StumbleUpon', 'briar')), 'skype' => array('label' => __('Skype', 'briar')), 'tumblr' => array('label' => __('Tumblr', 'briar')), 'vimeo' => array('label' => __('Vimeo', 'briar')), 'behance' => array('label' => __('Behance', 'briar'))), 'section' => 'footer')));
    /* -------		Front 	 		------- */
    $wp_customize->get_section('static_front_page')->title = __('Front', 'briar');
}