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.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

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.			$wp_customize->get_setting( 'blogname' )->transport        = 'postMessage'; // @phpstan-ignore-line. Assume that this setting exists.			$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; // @phpstan-ignore-line. Assume that this setting exists. 			// 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',				array(					'capability'        => 'edit_theme_options',					'default'           => 'excerpt',					'sanitize_callback' => static function ( $value ) {

Changelog

Introduced in Twenty Twenty-One 1.0. Unchanged from 6.7.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

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

About this page

Parsed data
Generated from the wordpress-develop 6.9.10 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.