• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / TwentyTwenty_Customize::register() – Register customizer options.

You appear to be a bot. Output may be restricted

Description

Register customizer options.

Usage

TwentyTwenty_Customize::register( $wp_customize );

Parameters

$wp_customize
( WP_Customize_Manager ) required – Theme Customizer object.

Returns

void

Source

File name: twentytwenty/classes/class-twentytwenty-customize.php


Lines:

1 to 100 of 397
    public static function register( $wp_customize ) {

      
/**
 * Site Title & Description.
 * */
      $wp_customize->get_setting( 'blogname' )->transport        = 'postMessage';
      $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';

      $wp_customize->selective_refresh->add_partial(
        'blogname',
        array(
          'selector'        => '.site-title a',
          'render_callback' => 'twentytwenty_customize_partial_blogname',
        )
      );

      $wp_customize->selective_refresh->add_partial(
        'blogdescription',
        array(
          'selector'        => '.site-description',
          'render_callback' => 'twentytwenty_customize_partial_blogdescription',
        )
      );

      $wp_customize->selective_refresh->add_partial(
        'custom_logo',
        array(
          'selector'            => '.header-titles [class*=site-]:not(.site-description)',
          'render_callback'     => 'twentytwenty_customize_partial_site_logo',
          'container_inclusive' => true,
        )
      );

      $wp_customize->selective_refresh->add_partial(
        'retina_logo',
        array(
          'selector'        => '.header-titles [class*=site-]:not(.site-description)',
          'render_callback' => 'twentytwenty_customize_partial_site_logo',
        )
      );

      
/**
 * Site Identity
 */

      /* 2X Header Logo ---------------- */
      $wp_customize->add_setting(
        'retina_logo',
        array(
          'capability'        => 'edit_theme_options',
          'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),
          'transport'         => 'postMessage',
        )
      );

      $wp_customize->add_control(
        'retina_logo',
        array(
          'type'        => 'checkbox',
          'section'     => 'title_tagline',
          'priority'    => 10,
          'label'       => __( 'Retina logo', 'twentytwenty' ),
          'description' => __( 'Scales the logo to half its uploaded size, making it sharp on high-res screens.', 'twentytwenty' ),
        )
      );

      // Header & Footer Background Color.
      $wp_customize->add_setting(
        'header_footer_background_color',
        array(
          'default'           => '#ffffff',
          'sanitize_callback' => 'sanitize_hex_color',
          'transport'         => 'postMessage',
        )
      );

      $wp_customize->add_control(
        new WP_Customize_Color_Control(
          $wp_customize,
          'header_footer_background_color',
          array(
            'label'   => __( 'Header & Footer Background Color', 'twentytwenty' ),
            'section' => 'colors',
          )
        )
      );

      // Enable picking an accent color.
      $wp_customize->add_setting(
        'accent_hue_active',
        array(
          'capability'        => 'edit_theme_options',
          'sanitize_callback' => array( __CLASS__, 'sanitize_select' ),
          'transport'         => 'postMessage',
          'default'           => 'default',
        )
      );

      $wp_customize->add_control(
[1] [2] [3] [4] Next »

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 26th January 2022

Primary Sidebar

Information

Function name: TwentyTwenty_Customize::register
Class ref: TwentyTwenty_Customize
Plugin ref: Twenty Twenty
Version: 2.1
Sourcefile: classes/class-twentytwenty-customize.php
File ref: classes/class-twentytwenty-customize.php
Deprecated?: No
API Letters: C,R,T

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites