wppaste
WordPress

WP_Customize_Theme_Control

Since
4.2.0
Source
wp-includes/customize/class-wp-customize-theme-control.php:17
Customize Theme Control class.

Compatibility

WordPress
since 4.2.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).

Properties · 2

$typestringpublic
Customize control type.
$themeWP_Themepublic
Theme object.

Methods · 3

Source code

class WP_Customize_Theme_Control extends WP_Customize_Control { 	/**	 * Customize control type.	 *	 * @since 4.2.0	 * @var string	 */	public $type = 'theme'; 	/**	 * Theme object.	 *	 * @since 4.2.0	 * @var WP_Theme	 */	public $theme; 	/**	 * Refresh the parameters passed to the JavaScript via JSON.	 *	 * @since 4.2.0	 *	 * @see WP_Customize_Control::to_json()	 */	public function to_json() {		parent::to_json();		$this->json['theme'] = $this->theme;	} 	/**	 * Don't render the control content from PHP, as it's rendered via JS on load.	 *	 * @since 4.2.0	 */	public function render_content() {} 	/**	 * Render a JS template for theme display.	 *	 * @since 4.2.0	 */	public function content_template() {		/* translators: %s: Theme name. */		$details_label = sprintf( __( 'Details for theme: %s' ), '{{ data.theme.name }}' );		/* translators: %s: Theme name. */		$customize_label = sprintf( __( 'Customize theme: %s' ), '{{ data.theme.name }}' );		/* translators: %s: Theme name. */		$preview_label = sprintf( __( 'Live preview theme: %s' ), '{{ data.theme.name }}' );		/* translators: %s: Theme name. */		$install_label = sprintf( __( 'Install and preview theme: %s' ), '{{ data.theme.name }}' );		?>		<# if ( data.theme.active ) { #>			<div class="theme active" tabindex="0" aria-describedby="{{ data.section }}-{{ data.theme.id }}-action">		<# } else { #>			<div class="theme" tabindex="0" aria-describedby="{{ data.section }}-{{ data.theme.id }}-action">		<# } #> 			<# if ( data.theme.screenshot && data.theme.screenshot[0] ) { #>				<div class="theme-screenshot">					<img data-src="{{ data.theme.screenshot[0] }}?ver={{ data.theme.version }}" alt="" />				</div>			<# } else { #>				<div class="theme-screenshot blank"></div>			<# } #> 			<span class="more-details theme-details" id="{{ data.section }}-{{ data.theme.id }}-action" aria-label="<?php echo esc_attr( $details_label ); ?>"><?php _e( 'Theme Details' ); ?></span> 			<div class="theme-author">			<?php				/* translators: Theme author name. */				printf( _x( 'By %s', 'theme author' ), '{{ data.theme.author }}' );			?>			</div> 			<# if ( 'installed' === data.theme.type && data.theme.hasUpdate ) { #>				<# if ( data.theme.updateResponse.compatibleWP && data.theme.updateResponse.compatiblePHP ) { #>					<div class="update-message notice inline notice-warning notice-alt" data-slug="{{ data.theme.id }}">						<p>							<?php

Changelog

Introduced in 4.2.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 6.7.7 tag, from src/wp-includes/customize/class-wp-customize-theme-control.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.