WP_Customize_Themes_Panel::render_template() WordPress Method

The WP_Customize_Themes_Panel::render_template() method is used to render the themes panel for the Customizer. This panel allows you to select and preview installed themes, and customize theme settings.

WP_Customize_Themes_Panel::render_template() #

An Underscore (JS) template for rendering this panel’s container.


Description

The themes panel renders a custom panel heading with the active theme and a switch themes button.

Top ↑

See also


Top ↑

Source

File: wp-includes/customize/class-wp-customize-themes-panel.php

	protected function render_template() {
		?>
		<li id="accordion-section-{{ data.id }}" class="accordion-section control-panel-themes">
			<h3 class="accordion-section-title">
				<?php
				if ( $this->manager->is_theme_active() ) {
					echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> {{ data.title }}';
				} else {
					echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> {{ data.title }}';
				}
				?>

				<?php if ( current_user_can( 'switch_themes' ) ) : ?>
					<button type="button" class="button change-theme" aria-label="<?php esc_attr_e( 'Change theme' ); ?>"><?php _ex( 'Change', 'theme' ); ?></button>
				<?php endif; ?>
			</h3>
			<ul class="accordion-sub-container control-panel-content"></ul>
		</li>
		<?php
	}


Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.