Bootstraps the Customize experience on the server-side. Sets up the theme-switching process if a theme other than the active one is being previewed and customized. Serves as a factory for Customize Controls and Settings, and instantiates default Customize Controls and Settings.
Since: 3.4.0
Example #1
1
/**
 * Theme Options Customizer Implementation.
 *
 * Implement the Theme Customizer for Theme Settings.
 *
 * @link http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/
 * 
 * @param WP_Customize_Manager $wp_customize Object that holds the customizer data.
 */
function theme_slug_register_customizer_panels($wp_customize)
{
    /*
     * Failsafe is safe
     */
    if (!isset($wp_customize)) {
        return;
    }
    /**
     * Add Panel for General Settings.
     * 
     * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
     * @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
     */
    $wp_customize->add_panel('theme_slug_panel_general', array('priority' => 10, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Theme Name General Settings', 'theme-slug'), 'description' => __('Configure general settings for the Theme Name Theme', 'theme-slug')));
    /**
     * Add Panel for Color and Layout Settings.
     * 
     * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
     * @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
     */
    $wp_customize->add_panel('theme_slug_panel_colorslayouts', array('priority' => 11, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Theme Name Colors and Layouts', 'theme-slug'), 'description' => __('Configure color and layout settings for the Theme Name Theme', 'theme-slug')));
    /**
     * Add Panel for Advanced Settings.
     * 
     * @uses $wp_customize->add_panel() https://developer.wordpress.org/reference/classes/wp_customize_manager/add_panel/
     * @link $wp_customize->add_panel() https://codex.wordpress.org/Class_Reference/WP_Customize_Manager/add_panel
     */
    $wp_customize->add_panel('theme_slug_panel_advanced', array('priority' => 12, 'capability' => 'edit_theme_options', 'theme_supports' => '', 'title' => __('Theme Name Advanced Settings', 'theme-slug'), 'description' => __('Configure advanced settings for the Theme Name Theme', 'theme-slug')));
}
Example #2
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function dbx_paper_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('sitelogo')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
}
 /**
  * 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
  * @link http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own-themes/
  * @since Hyde 1.0
  */
 public static function register($wp_customize)
 {
     //1. Register new settings to the WP database...
     $wp_customize->add_setting('header_fontsize', array('default' => null, 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage'));
     //2. Finally, we define the control itself (which links a setting to a section and renders the HTML controls)...
     $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'hyde_header_fontsize', array('label' => __('Header Fontsize', 'hyde'), 'section' => 'title_tagline', 'settings' => 'header_fontsize', 'priority' => 10)));
 }
Example #4
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'));
    }
}
/**
 * Adds postMessage support for site title and description for the Customizer.
 *
 * @since Twenty Sixteen 1.0
 *
 * @param WP_Customize_Manager $wp_customize The Customizer object.
 */
function twentysixteen_child_customize_register($wp_customize)
{
    $color_scheme = twentysixteen_get_color_scheme();
    // Add secondary text color setting and control.
    $wp_customize->add_setting('header_text_color', array('default' => $color_scheme[5], 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_text_color', array('label' => __('Header Text Color', 'twentysixteenchild'), 'section' => 'colors')));
}
Example #6
0
 /**
  * @param WP_Customize_Manager $wp_customize
  * @internal
  */
 function _action_customizer_live_fw_options($wp_customize)
 {
     if ($wp_customize->get_setting('fw_options[OPTION_ID]')) {
         $wp_customize->get_setting('fw_options[OPTION_ID]')->transport = 'postMessage';
         add_action('customize_preview_init', '_action_customizer_live_fw_options_preview');
     }
 }
Example #7
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function bbird_under_customize_register($wp_customize)
{
    $wp_customize->add_panel('footer_panel', array('priority' => 120, 'capability' => 'edit_theme_options', 'title' => __('Footer', 'bbird-under')));
    $wp_customize->add_section('footer_widgets', array('title' => __('Widget options', 'bbird-under'), 'priority' => 12, 'panel' => 'footer_panel'));
    $wp_customize->add_setting('footer_widgets', array('default' => 'no', 'sanitize_callback' => 'bbird_under_sanitize_select'));
    $wp_customize->add_control('footer_widgets', array('type' => 'radio', 'label' => __('Choose the number of footer widgets', 'bbird-under'), 'section' => 'footer_widgets', 'choices' => array('no' => __('No widgets', 'bbird-under'), 'one' => __('One (Full width)', 'bbird-under'), 'two' => __('Two (One Half)', 'bbird-under'), 'three' => __('Three (One-third layout)', 'bbird-under'), 'four' => __('Four (One-fourth layout)', 'bbird-under'))));
}
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function twentyfourteen_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->add_setting('accent_color', array('default' => '#24890d', 'sanitize_callback' => 'twentyfourteen_generate_accent_colors'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'accent_color', array('label' => __('Accent Color', 'twentyfourteen'), 'section' => 'colors', 'settings' => 'accent_color')));
}
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function coursepress_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';
    $colors = array();
    $colors[] = array('slug' => 'body_text_color', 'default' => '#878786', 'label' => __('Body Text Color', 'cp'));
    $colors[] = array('slug' => 'content_text_color', 'default' => '#666666', 'label' => __('Content Text Color', 'cp'));
    $colors[] = array('slug' => 'content_header_color', 'default' => '#878786', 'label' => __('Content Header Color', 'cp'));
    $colors[] = array('slug' => 'content_link_color', 'default' => '#1cb8ea', 'label' => __('Content Links Color', 'cp'));
    $colors[] = array('slug' => 'content_link_hover_color', 'default' => '#1cb8ea', 'label' => __('Content Links Hover Color', 'cp'));
    $colors[] = array('slug' => 'main_navigation_link_color', 'default' => '#666', 'label' => __('Main Navigation Links Color', 'cp'));
    $colors[] = array('slug' => 'main_navigation_link_hover_color', 'default' => '#74d1d4', 'label' => __('Main Navigation Links Hover Color', 'cp'));
    $colors[] = array('slug' => 'footer_background_color', 'default' => '#f2f6f8', 'label' => __('Footer Background Color', 'cp'));
    $colors[] = array('slug' => 'footer_link_color', 'default' => '#83abb6', 'label' => __('Footer Links Color', 'cp'));
    $colors[] = array('slug' => 'footer_link_hover_color', 'default' => '#74d1d4', 'label' => __('Footer Links Hover Color', 'cp'));
    $colors[] = array('slug' => 'widget_title_color', 'default' => '#c0c21e', 'label' => __('Widgets Title Color', 'cp'));
    sort($colors);
    foreach ($colors as $color) {
        // SETTINGS
        $wp_customize->add_setting($color['slug'], array('default' => $color['default'], 'type' => 'option', 'capability' => 'edit_theme_options'));
        // CONTROLS
        $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $color['slug'], array('label' => $color['label'], 'section' => 'colors', 'settings' => $color['slug'])));
    }
    $wp_customize->add_setting('coursepress_logo', array('default' => get_template_directory_uri() . '/images/logo-default.png', 'type' => 'theme_mod', 'capability' => 'edit_theme_options'));
    $wp_customize->add_section('cp_logo_section', array('title' => __('Logo', 'cp'), 'priority' => 1));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array('label' => __('Upload a logo', 'cp'), 'section' => 'cp_logo_section', 'settings' => 'coursepress_logo')));
    if ($wp_customize->is_preview() && !is_admin()) {
        add_action('wp_footer', 'coursepress_customize_preview', 21);
    }
}
Example #10
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function areavoices_customize_register($wp_customize)
{
    // var_dump( $wp_customize->settings() );
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
}
Example #11
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function shapely_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->get_setting('custom_logo')->transport = 'refresh';
    // Abort if selective refresh is not available.
    if (!isset($wp_customize->selective_refresh)) {
        return;
    }
    $wp_customize->selective_refresh->add_partial('blogname', array('selector' => '.site-title', 'render_callback' => function () {
        bloginfo('name');
    }));
    $wp_customize->selective_refresh->add_partial('footer_callout_text', array('selector' => '.footer-callout', 'render_callback' => function () {
        shapely_footer_callout();
    }));
    $wp_customize->selective_refresh->add_partial('footer_callout_btntext', array('selector' => '.footer-callout', 'render_callback' => function () {
        shapely_footer_callout();
    }));
    $wp_customize->selective_refresh->add_partial('footer_callout_link', array('selector' => '.footer-callout', 'render_callback' => function () {
        shapely_footer_callout();
    }));
    $wp_customize->selective_refresh->add_partial('blog_name', array('selector' => '.header-callout', 'render_callback' => function () {
        shapely_top_callout();
    }));
    $wp_customize->selective_refresh->add_partial('header_textcolor', array('selector' => '.header-callout', 'render_callback' => function () {
        shapely_top_callout();
    }));
}
Example #12
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function tonal_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->get_setting('background_image')->transport = 'postMessage';
}
Example #13
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function create_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';
    class CreateImportantLinks extends WP_Customize_Control
    {
        public $type = 'important-links';
        public function render_content()
        {
            //Add Theme instruction, Support Forum, Changelog, Donate link, Review, Facebook, Twitter, Google+, Pinterest links
            $important_links = array('theme_instructions' => array('link' => esc_url('http://catchthemes.com/theme-instructions/create/'), 'text' => __('Theme Instructions', 'create')), 'support' => array('link' => esc_url('http://catchthemes.com/support/'), 'text' => __('Support', 'create')), 'changelog' => array('link' => esc_url('http://catchthemes.com/changelogs/create-theme/'), 'text' => __('Changelog', 'create')), 'donate' => array('link' => esc_url('http://catchthemes.com/donate/'), 'text' => __('Donate Now', 'create')), 'review' => array('link' => esc_url('https://wordpress.org/support/view/theme-reviews/create'), 'text' => __('Review', 'create')), 'facebook' => array('link' => esc_url('https://www.facebook.com/catchthemes/'), 'text' => __('Facebook', 'create')), 'twitter' => array('link' => esc_url('https://twitter.com/catchthemes/'), 'text' => __('Twitter', 'create')), 'gplus' => array('link' => esc_url('https://plus.google.com/+Catchthemes/'), 'text' => __('Google+', 'create')), 'pinterest' => array('link' => esc_url('http://www.pinterest.com/catchthemes/'), 'text' => __('Pinterest', 'create')));
            foreach ($important_links as $important_link) {
                echo '<p><a target="_blank" href="' . $important_link['link'] . '" >' . $important_link['text'] . ' </a></p>';
            }
        }
    }
    //Important Links
    $wp_customize->add_section('important_links', array('priority' => 999, 'title' => __('Important Links', 'create')));
    /**
     * Has dummy Sanitizaition function as it contains no value to be sanitized
     */
    $wp_customize->add_setting('important_links', array('sanitize_callback' => 'create_sanitize_important_link'));
    $wp_customize->add_control(new CreateImportantLinks($wp_customize, 'important_links', array('label' => __('Important Links', 'create'), 'section' => 'important_links', 'settings' => 'important_links', 'type' => 'important_links')));
    //Important Links End
}
Example #14
0
/**
 * @param WP_Customize_Manager $wp_customize
 */
function dimme_jour_customize_register($wp_customize)
{
    $wp_customize->add_setting('dimme_jour_options[logo]', array('capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_url_raw'));
    $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array('label' => __('Frontpage logo', 'dimme-jour'), 'section' => 'title_tagline', 'settings' => 'dimme_jour_options[logo]')));
    $wp_customize->add_setting('dimme_jour_options[full_page_frontpage]', array('capability' => 'edit_theme_options', 'type' => 'option', 'sanitize_callback' => 'esc_html'));
    $wp_customize->add_control(new WP_Customize_Control($wp_customize, 'full_page_frontpage', array('settings' => 'dimme_jour_options[full_page_frontpage]', 'label' => __('Show fullscreen frontpage', 'dimme-jour'), 'section' => 'title_tagline', 'type' => 'checkbox')));
}
Example #15
0
 /**
  * Adds the control.
  *
  * @access protected
  * @param array $args The field definition as sanitized in Kirki_Field.
  */
 protected final function add_control($args)
 {
     // Get the name of the class we're going to use.
     $class_name = $this->get_control_class_name($args);
     // Add the control.
     $this->wp_customize->add_control(new $class_name($this->wp_customize, $args['settings'], $args));
 }
Example #16
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 *
 * @since NARGA v1.6
 */
function narga_customize_register($wp_customize)
{
    $readmore = narga_options('post_readmore');
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->get_setting('header_textcolor')->transport = 'postMessage';
}
Example #17
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");
}
 /**
  * Constructor.
  *
  * Supplied $args override class property defaults.
  *
  * If $args['fields'] is not defined, use the $id as the field ID.
  *
  * @since 3.4.0
  *
  * @param WP_Customize_Manager $manager
  * @param string $id
  * @param array $args
  */
 public function __construct($manager, $id, $args = array())
 {
     $this->manager = $manager;
     $this->object_name = $this->manager->get_customizer_object_name();
     // Backwards compatibility for old property names
     foreach ($this->property_map as $backcompat_arg => $actual_arg) {
         if (isset($args[$backcompat_arg])) {
             $args[$actual_arg] = $args[$backcompat_arg];
             unset($args[$backcompat_arg]);
         }
     }
     parent::__construct($this->object_type, $id, $args);
     if (empty($this->active_callback)) {
         $this->active_callback = array($this, 'active_callback');
     }
     if (!has_action('fields_render_control_' . $this->object_type, array('WP_Customize_Control', 'customize_render_control'))) {
         add_action('fields_render_control_' . $this->object_type, array('WP_Customize_Control', 'customize_render_control'));
     }
     if (!has_filter('fields_control_active_' . $this->object_type, array('WP_Customize_Control', 'customize_control_active'))) {
         add_filter('fields_control_active_' . $this->object_type, array('WP_Customize_Control', 'customize_control_active'), 10, 2);
     }
     if ('' !== $this->id) {
         add_action('fields_render_control_' . $this->object_type . '_' . $this->object_name . '_' . $this->id, array('WP_Customize_Control', 'customize_render_control_id'));
     }
 }
Example #19
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function dazzling_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->get_setting('header_textcolor')->default = '#1FA67A';
}
Example #20
0
 /**
  * Create all panels and sections
  *
  * @param \WP_Customize_Manager $wp_customize the WP customizer
  * @return \WP_Customize_Manager
  */
 public function createPanels($wp_customize)
 {
     $data = $this->getData();
     // Move all default sections to the default panel
     $defaultPanel = $data['options']['default_panel'];
     $wp_customize->add_panel($defaultPanel['id'], array('priority' => 10, 'title' => Strings::translate($defaultPanel['title']), 'description' => ''));
     $existingSections = $wp_customize->sections();
     /** @var \WP_Customize_Section $section */
     foreach ($existingSections as $sectionId => $section) {
         if (empty($section->panel)) {
             $section->panel = $defaultPanel['id'];
         }
     }
     // Define additional panels and sections
     $panels = $data['panels'];
     $panelPriority = 1000;
     foreach ($panels as $panelProps) {
         if (isset($panelProps['title'])) {
             $panelId = 'panel-' . $panelPriority;
             $wp_customize->add_panel($panelId, array('priority' => $panelPriority, 'title' => Strings::translate($panelProps['title']), 'description' => Strings::translate($panelProps['description'])));
         } else {
             $panelId = $defaultPanel['id'];
         }
         $sectionPriority = 10;
         foreach ($panelProps['sections'] as $sectionId => $sectionProps) {
             $wp_customize->add_section($sectionId, array('panel' => $panelId, 'priority' => $sectionPriority, 'title' => Strings::translate($sectionProps['title']), 'description' => Strings::translate($sectionProps['description'])));
             $sectionPriority += 10;
         }
         $panelPriority += 10;
     }
     return $wp_customize;
 }
Example #21
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function xsbf_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->get_setting('header_textcolor')->transport = 'refresh';
}
Example #22
0
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function aventurine_customize_register($wp_customize)
{
    $wp_customize->get_setting('blogname')->transport = 'postMessage';
    $wp_customize->get_setting('blogdescription')->transport = 'postMessage';
    $wp_customize->add_setting('header_color', array('default' => 'ffffff', 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_hex_color_no_hash', 'sanitize_js_callback' => 'maybe_hash_hex_color'));
    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_color', array('label' => __('Header Color', 'aventurine'), 'section' => 'colors', 'settings' => 'header_color')));
}
Example #23
0
/**
 * Add LOGO fields for the Customizer.
 *
 * @since Custom LOGO 1.0
 *
 * @param WP_Customize_Manager $wp_customize_manager Customizer object.
 */
function logo_customize_register($wp_customize_manager)
{
    // ------ background section
    $wp_customize_manager->add_section('logo_customizer', array('title' => __('Logo', CUSTOM_PLUGIN_TEXT_DOMAIN)));
    // logo
    $wp_customize_manager->add_setting('logo_image', array('transport' => 'refresh'));
    $wp_customize_manager->add_control(new WP_Customize_Image_Control($wp_customize_manager, 'custom_logo', array('section' => 'logo_customizer', 'settings' => 'logo_image')));
}
/**
 * Add postMessage support for site title and description for the Theme Customizer.
 *
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
 */
function great_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 site description (tagline).
    $wp_customize->remove_control('blogdescription');
}
Example #25
0
 /**
  * Create the Fields/Settings for this sections
  *
  * @param  WP_Customize_Section $section The WordPress section instance
  * @param  WP_Customize_Manager $manager [description]
  *
  * @return void
  */
 public function register_settings(WP_Customize_Section $section, WP_Customize_Manager $manager)
 {
     $customizer = Tribe__Events__Pro__Customizer__Main::instance();
     $manager->add_setting($customizer->get_setting_name('bg_color', $section), array('default' => $this->get_default('bg_color'), 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color'));
     $manager->add_control(new WP_Customize_Color_Control($manager, $customizer->get_setting_name('bg_color', $section), array('label' => __('Photo Background Color', 'tribe-events-calendar-pro'), 'section' => $section->id)));
     // Introduced to make Selective Refresh have less code duplication
     $customizer->add_setting_name($customizer->get_setting_name('bg_color', $section));
 }
Example #26
0
 /**
  * Add social link dropdown to the Customizer.
  *
  * @param WP_Customize_Manager $wp_customize Theme Customizer object.
  */
 public function customize_register($wp_customize)
 {
     $wp_customize->add_section('jetpack_social_links', array('title' => __('Connect', 'jetpack'), 'priority' => 35));
     foreach ($this->services as $service) {
         $wp_customize->add_setting("jetpack_options[social_links][{$service}]", array('type' => 'option', 'default' => '', 'sanitize_callback' => 'esc_url_raw'));
         $wp_customize->add_control("jetpack-{$service}", array('label' => $this->publicize->get_service_label($service), 'section' => 'jetpack_social_links', 'settings' => "jetpack_options[social_links][{$service}]", 'type' => 'select', 'choices' => $this->get_customize_select($service)));
     }
 }
 /**
  * Add a select box drop down to theme customizer to control global column layout.
  *
  * @since 0.1.0
  *
  * @param WP_Customize_Manager $wp_customize Customizer object.
  *
  * @return void
  */
 public function theme_customizer_register_column_layout($wp_customize)
 {
     global $wpgo_customizer_defaults;
     $column_array = array('1-col' => __('1-Column (full width)', 'wpgothemes'), '2-col-l' => __('2-Column Sidebar Left', 'wpgothemes'), '2-col-r' => __('2-Column Sidebar Right', 'wpgothemes'), '3-col-l' => __('3-Column Sidebars Left', 'wpgothemes'), '3-col-r' => __('3-Column Sidebars Right', 'wpgothemes'), '3-col-c' => __('3-Column Sidebars Center', 'wpgothemes'));
     $wp_customize->add_section('wpgo_column_layout', array('title' => __('Column Layout', 'wpgothemes'), 'priority' => 41));
     $wp_customize->add_setting(WPGO_CUSTOMIZE_DB_NAME . '[wpgo_drp_default_layout]', array('default' => $wpgo_customizer_defaults['wpgo_drp_default_layout'], 'type' => 'option'));
     $wp_customize->add_control(WPGO_CUSTOMIZE_DB_NAME . '[wpgo_drp_default_layout]', array('label' => __('Select Global Column Layout', 'wpgothemes'), 'section' => 'wpgo_column_layout', 'type' => 'select', 'choices' => $column_array));
 }
Example #28
0
/**
 * Add GoogleAnalytics fields for the Customizer.
 *
 * @since Custom SEO 1.0
 *
 * @param WP_Customize_Manager $wp_customize_manager Customizer object.
 */
function googleanalytics_customize_register($wp_customize_manager)
{
    // googleanalytics section
    $wp_customize_manager->add_section('googleanalytics_customizer', array('title' => 'Google Analytics'));
    // meta title
    $wp_customize_manager->add_setting('googleanalytics_code', array('type' => 'theme_mod', 'transport' => 'postMessage'));
    $wp_customize_manager->add_control('googleanalytics_code', array('label' => __('Code', CUSTOM_PLUGIN_TEXT_DOMAIN), 'section' => 'googleanalytics_customizer', 'settings' => 'googleanalytics_code'));
}
 /**
  * Create the Fields/Settings for this sections
  *
  * @param  WP_Customize_Section $section The WordPress section instance
  * @param  WP_Customize_Manager $manager [description]
  *
  * @return void
  */
 public function settings(WP_Customize_Section $section, WP_Customize_Manager $manager)
 {
     $customizer = Tribe__Events__Pro__Customizer__Main::instance();
     $manager->add_setting($customizer->get_setting_name('calendar_header_color', $section), array('default' => $this->get_default('calendar_header_color'), 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color'));
     $manager->add_control(new WP_Customize_Color_Control($manager, $customizer->get_setting_name('calendar_header_color', $section), array('label' => __('Calendar Header Color'), 'section' => $section->id)));
     $manager->add_setting($customizer->get_setting_name('calendar_datebar_color', $section), array('default' => $this->get_default('calendar_datebar_color'), 'type' => 'option', 'sanitize_callback' => 'sanitize_hex_color', 'sanitize_js_callback' => 'maybe_hash_hex_color'));
     $manager->add_control(new WP_Customize_Color_Control($manager, $customizer->get_setting_name('calendar_datebar_color', $section), array('label' => __('Calendar Date Bar Color'), 'section' => $section->id)));
 }
 public function hooks_theme_customizer_modified(WP_Customize_Manager $obj)
 {
     $aal_args = array('action' => 'updated', 'object_type' => 'Theme', 'object_subtype' => $obj->theme()->display('Name'), 'object_id' => 0, 'object_name' => 'Theme Customizer');
     if ('customize_preview_init' === current_filter()) {
         $aal_args['action'] = 'accessed';
     }
     aal_insert_log($aal_args);
 }