3
* Customize API: WP_Customize_Themes_Panel class
6
* @subpackage Customize
11
* Customize Themes Panel Class
15
* @see WP_Customize_Panel
17
class WP_Customize_Themes_Panel extends WP_Customize_Panel {
25
public $type = 'themes';
28
* An Underscore (JS) template for rendering this panel's container.
30
* The themes panel renders a custom panel heading with the current theme and a switch themes button.
32
* @see WP_Customize_Panel::print_template()
36
protected function render_template() {
38
<li id="accordion-section-{{ data.id }}" class="accordion-section control-panel-themes">
39
<h3 class="accordion-section-title">
41
if ( $this->manager->is_theme_active() ) {
42
echo '<span class="customize-action">' . __( 'Active theme' ) . '</span> {{ data.title }}';
44
echo '<span class="customize-action">' . __( 'Previewing theme' ) . '</span> {{ data.title }}';
48
<?php if ( current_user_can( 'switch_themes' ) ) : ?>
49
<button type="button" class="button change-theme" aria-label="<?php esc_attr_e( 'Change theme' ); ?>"><?php _ex( 'Change', 'theme' ); ?></button>
52
<ul class="accordion-sub-container control-panel-content"></ul>
58
* An Underscore (JS) template for this panel's content (but not its container).
60
* Class variables for this panel class are available in the `data` JS object;
61
* export custom variables by overriding WP_Customize_Panel::json().
65
* @see WP_Customize_Panel::print_template()
67
protected function content_template() {
69
<li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
70
<button class="customize-panel-back" tabindex="-1" type="button"><span class="screen-reader-text"><?php _e( 'Back' ); ?></span></button>
71
<div class="accordion-section-title">
72
<span class="preview-notice">
74
/* translators: %s: themes panel title in the Customizer */
75
echo sprintf( __( 'You are browsing %s' ), '<strong class="panel-title">' . __( 'Themes' ) . '</strong>' ); // Separate strings for consistency with other panels.
78
<?php if ( current_user_can( 'install_themes' ) && ! is_multisite() ) : ?>
79
<# if ( data.description ) { #>
80
<button class="customize-help-toggle dashicons dashicons-editor-help" type="button" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
84
<?php if ( current_user_can( 'install_themes' ) && ! is_multisite() ) : ?>
85
<# if ( data.description ) { #>
86
<div class="description customize-panel-description">
87
{{{ data.description }}}
92
<div class="customize-control-notifications-container"></div>
94
<li class="customize-themes-full-container-container">
95
<div class="customize-themes-full-container">
96
<div class="customize-themes-notifications"></div>