wppaste
WordPress

Twenty_Twenty_One_Customize

Since
Twenty Twenty-One 1.0
Source
wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php:16
Customizer Settings.

Compatibility

WordPress
since Twenty Twenty-One 1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Methods · 5

Source code

	class Twenty_Twenty_One_Customize { 		/**		 * Constructor. Instantiates the object.		 *		 * @since Twenty Twenty-One 1.0		 */		public function __construct() {			add_action( 'customize_register', array( $this, 'register' ) );		} 		/**		 * Registers customizer options.		 *		 * @since Twenty Twenty-One 1.0		 *		 * @param WP_Customize_Manager $wp_customize Theme Customizer object.		 * @return void		 */		public function register( $wp_customize ) { 			// Change site-title & description to postMessage.			foreach ( array( 'blogname', 'blogdescription' ) as $setting_id ) {				$setting = $wp_customize->get_setting( $setting_id );				if ( $setting ) {					$setting->transport = 'postMessage';				}			} 			// Add partial for blogname.			$wp_customize->selective_refresh->add_partial(				'blogname',				array(					'selector'        => '.site-title',					'render_callback' => array( $this, 'partial_blogname' ),				)			); 			// Add partial for blogdescription.			$wp_customize->selective_refresh->add_partial(				'blogdescription',				array(					'selector'        => '.site-description',					'render_callback' => array( $this, 'partial_blogdescription' ),				)			); 			// Add "display_title_and_tagline" setting for displaying the site-title & tagline.			$wp_customize->add_setting(				'display_title_and_tagline',				array(					'capability'        => 'edit_theme_options',					'default'           => true,					'sanitize_callback' => array( __CLASS__, 'sanitize_checkbox' ),				)			); 			// Add control for the "display_title_and_tagline" setting.			$wp_customize->add_control(				'display_title_and_tagline',				array(					'type'    => 'checkbox',					'section' => 'title_tagline',					'label'   => esc_html__( 'Display Site Title & Tagline', 'twentytwentyone' ),				)			); 			/**			 * Add excerpt or full text selector to customizer			 */			$wp_customize->add_section(				'excerpt_settings',				array(					'title'    => esc_html__( 'Excerpt Settings', 'twentytwentyone' ),					'priority' => 120,				)			); 			$wp_customize->add_setting(				'display_excerpt_or_full_post',

Changelog

Introduced in Twenty Twenty-One 1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.