_e( 'This theme doesn’t work with your version of PHP.' );
if ( current_user_can( 'update_php' ) ) {
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
<span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
<div class="theme-author">
/* translators: %s: Theme author name. */
printf( __( 'By %s' ), $theme['author'] );
<div class="theme-id-container">
<?php if ( $theme['active'] ) { ?>
<h2 class="theme-name" id="<?php echo $aria_name; ?>">
<span><?php _ex( 'Active:', 'theme' ); ?></span> <?php echo $theme['name']; ?>
<h2 class="theme-name" id="<?php echo $aria_name; ?>"><?php echo $theme['name']; ?></h2>
<div class="theme-actions">
<?php if ( $theme['active'] ) { ?>
<?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
<a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a>
<?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?>
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
<a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
<?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
<a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
<a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
<?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
<a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
// List broken themes, if any.
$broken_themes = wp_get_themes( array( 'errors' => true ) );
if ( ! is_multisite() && $broken_themes ) {
<div class="broken-themes">
<h3><?php _e( 'Broken Themes' ); ?></h3>
<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>
$can_resume = current_user_can( 'resume_themes' );
$can_delete = current_user_can( 'delete_themes' );
$can_install = current_user_can( 'install_themes' );
<th><?php _ex( 'Name', 'theme name' ); ?></th>
<th><?php _e( 'Description' ); ?></th>
<?php if ( $can_resume ) { ?>
<?php if ( $can_delete ) { ?>
<?php if ( $can_install ) { ?>
<?php foreach ( $broken_themes as $broken_theme ) : ?>
<td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ); ?></td>
<td><?php echo $broken_theme->errors()->get_error_message(); ?></td>
if ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) {
$stylesheet = $broken_theme->get_stylesheet();
$resume_url = add_query_arg(
'stylesheet' => urlencode( $stylesheet ),
admin_url( 'themes.php' )
$resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet );
<td><a href="<?php echo esc_url( $resume_url ); ?>" class="button resume-theme"><?php _e( 'Resume' ); ?></a></td>
$stylesheet = $broken_theme->get_stylesheet();
$delete_url = add_query_arg(
'stylesheet' => urlencode( $stylesheet ),
admin_url( 'themes.php' )
$delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
<td><a href="<?php echo esc_url( $delete_url ); ?>" class="button delete-theme"><?php _e( 'Delete' ); ?></a></td>
if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) {
$parent_theme_name = $broken_theme->get( 'Template' );
$parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) );
if ( ! is_wp_error( $parent_theme ) ) {
$install_url = add_query_arg(
'action' => 'install-theme',
'theme' => urlencode( $parent_theme_name ),
admin_url( 'update.php' )
$install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );
<td><a href="<?php echo esc_url( $install_url ); ?>" class="button install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td>
* Returns the JavaScript template used to display the auto-update setting for a theme.
* @return string The template for displaying the auto-update setting link.
function wp_theme_auto_update_setting_template() {
<div class="theme-autoupdate">
<# if ( data.autoupdate.supported ) { #>
<# if ( data.autoupdate.forced === false ) { #>
' . __( 'Auto-updates disabled' ) . '
<# } else if ( data.autoupdate.forced ) { #>
' . __( 'Auto-updates enabled' ) . '
<# } else if ( data.autoupdate.enabled ) { #>
<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="disable">
<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Disable auto-updates' ) . '</span>
<button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="enable">
<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Enable auto-updates' ) . '</span>
<# if ( data.hasUpdate ) { #>
<# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #>
<span class="auto-update-time">
<span class="auto-update-time hidden">
<br />' . wp_get_auto_update_message() . '</span>
<div class="notice notice-error notice-alt inline hidden"><p></p></div>
* Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay).
* See {@see wp_prepare_themes_for_js()} for the properties of the `data` object.
* @param string $template The template for displaying the auto-update setting link.
return apply_filters( 'theme_auto_update_setting_template', $template );
* The tmpl-theme template is synchronized with PHP above!
<script id="tmpl-theme" type="text/template">
<# if ( data.screenshot[0] ) { #>
<div class="theme-screenshot">
<img src="{{ data.screenshot[0] }}" alt="" />
<div class="theme-screenshot blank"></div>
<# if ( data.hasUpdate ) { #>
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>
<div class="update-message notice inline notice-warning notice-alt"><p>
<# if ( data.hasPackage ) { #>
<?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?>
<?php _e( 'New version available.' ); ?>
<div class="update-message notice inline notice-error notice-alt"><p>
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn’t work with your versions of WordPress and PHP.' ),
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
} elseif ( current_user_can( 'update_php' ) ) {
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
<# } else if ( ! data.updateResponse.compatibleWP ) { #>
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn’t work with your version of WordPress.' ),
if ( current_user_can( 'update_core' ) ) {
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
<# } else if ( ! data.updateResponse.compatiblePHP ) { #>
/* translators: %s: Theme name. */
__( 'There is a new version of %s available, but it doesn’t work with your version of PHP.' ),
if ( current_user_can( 'update_php' ) ) {
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #>
<div class="notice notice-error notice-alt"><p>
<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>
_e( 'This theme doesn’t work with your versions of WordPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
} elseif ( current_user_can( 'update_php' ) ) {
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
<# } else if ( ! data.compatibleWP ) { #>
_e( 'This theme doesn’t work with your version of WordPress.' );
if ( current_user_can( 'update_core' ) ) {
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
<# } else if ( ! data.compatiblePHP ) { #>
_e( 'This theme doesn’t work with your version of PHP.' );
if ( current_user_can( 'update_php' ) ) {
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
<span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span>
<div class="theme-author">
/* translators: %s: Theme author name. */
printf( __( 'By %s' ), '{{{ data.author }}}' );
<div class="theme-id-container">
<# if ( data.active ) { #>
<h2 class="theme-name" id="{{ data.id }}-name">
<span><?php _ex( 'Active:', 'theme' ); ?></span> {{{ data.name }}}
<h2 class="theme-name" id="{{ data.id }}-name">{{{ data.name }}}</h2>
<div class="theme-actions">
<# if ( data.active ) { #>
<# if ( data.actions.customize ) { #>
<a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
<# if ( data.compatibleWP && data.compatiblePHP ) { #>
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
<a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
<a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
<a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
<a class="button button-primary hide-if-no-customize disabled"><?php _e( 'Live Preview' ); ?></a>
<script id="tmpl-theme-single" type="text/template">
<div class="theme-backdrop"></div>
<div class="theme-wrap wp-clearfix" role="document">
<div class="theme-header">
<button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button>
<button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button>
<button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close details dialog' ); ?></span></button>
<div class="theme-about wp-clearfix">
<div class="theme-screenshots">
<# if ( data.screenshot[0] ) { #>
<div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
<div class="screenshot blank"></div>
<# if ( data.active ) { #>
<span class="current-label"><?php _e( 'Current Theme' ); ?></span>
<h2 class="theme-name">{{{ data.name }}}<span class="theme-version">
/* translators: %s: Theme version. */
printf( __( 'Version: %s' ), '{{ data.version }}' );
/* translators: %s: Theme author link. */
printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' );
<# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #>
<div class="notice notice-error notice-alt notice-large"><p>
<# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #>
_e( 'This theme doesn’t work with your versions of WordPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
} elseif ( current_user_can( 'update_php' ) ) {
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
<# } else if ( ! data.compatibleWP ) { #>
_e( 'This theme doesn’t work with your version of WordPress.' );
if ( current_user_can( 'update_core' ) ) {
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
<# } else if ( ! data.compatiblePHP ) { #>
_e( 'This theme doesn’t work with your version of PHP.' );
if ( current_user_can( 'update_php' ) ) {
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
wp_update_php_annotation( '</p><p><em>', '</em>' );
<# if ( data.hasUpdate ) { #>
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>
<div class="notice notice-warning notice-alt notice-large">
<h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>