WordPress at a glance
function is not described

WP_Customize_Themes_Panel::render_template() WP 4.9.0

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

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

This is a method of the class: WP_Customize_Themes_Panel

No Hooks.

Return

Null. Nothing.

Usage

$WP_Customize_Themes_Panel = new WP_Customize_Themes_Panel();
$var = $WP_Customize_Themes_Panel->render_template();

Notes

  • See: WP_Customize_Panel::print_template()

Changelog

Since 4.9.0 Introduced.

Code of WP Customize Themes Panel::render template: wp-includes/customize/class-wp-customize-themes-panel.php WP 5.2.2

<?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
}