wppaste
WordPress

WP_Customize_Themes_Section

Since
4.2.0
Source
wp-includes/customize/class-wp-customize-themes-section.php:19
Customize Themes Section class.

Description

A UI container for theme controls, which are displayed within sections.

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 · 3

$typestringpublic
Section type.
$actionstringpublic
Theme section action.
$filter_typestringpublic
Theme section filter type.

Methods · 4

Source code

class WP_Customize_Themes_Section extends WP_Customize_Section { 	/**	 * Section type.	 *	 * @since 4.2.0	 * @var string	 */	public $type = 'themes'; 	/**	 * Theme section action.	 *	 * Defines the type of themes to load (installed, wporg, etc.).	 *	 * @since 4.9.0	 * @var string	 */	public $action = ''; 	/**	 * Theme section filter type.	 *	 * Determines whether filters are applied to loaded (local) themes or by initiating a new remote query (remote).	 * When filtering is local, the initial themes query is not paginated by default.	 *	 * @since 4.9.0	 * @var string	 */	public $filter_type = 'local'; 	/**	 * Gets section parameters for JS.	 *	 * @since 4.9.0	 * @return array Exported parameters.	 */	public function json() {		$exported                = parent::json();		$exported['action']      = $this->action;		$exported['filter_type'] = $this->filter_type; 		return $exported;	} 	/**	 * Renders a themes section as a JS template.	 *	 * The template is only rendered by PHP once, so all actions are prepared at once on the server side.	 *	 * @since 4.9.0	 */	protected function render_template() {		?>		<li id="accordion-section-{{ data.id }}" class="theme-section">			<button type="button" class="customize-themes-section-title themes-section-{{ data.id }}">{{ data.title }}</button>			<?php if ( current_user_can( 'install_themes' ) || is_multisite() ) : // @todo Upload support. ?>			<?php endif; ?>			<div class="customize-themes-section themes-section-{{ data.id }} control-section-content themes-php">				<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>				<div class="theme-browser rendered">					<div class="customize-preview-header themes-filter-bar">						<?php $this->filter_bar_content_template(); ?>					</div>					<?php $this->filter_drawer_content_template(); ?>					<div class="error unexpected-error" style="display: none; ">						<p>							<?php							printf(								/* translators: %s: Support forums URL. */								__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),								__( 'https://wordpress.org/support/forums/' )							);							?>						</p>					</div>					<ul class="themes">					</ul>					<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>					<p class="no-themes-local">

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 7.1.0 tag, from src/wp-includes/customize/class-wp-customize-themes-section.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.