Themes: Display a message in theme grid and Theme Details modal if a theme update requires a higher version of PHP or WordPress.
This applies to the Themes screen and the Customizer theme browser. Props afragen, SergeyBiryukov. See #48491. git-svn-id: https://develop.svn.wordpress.org/trunk@48652 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
72dfc468c5
commit
7ea44b5add
@ -684,27 +684,34 @@ function wp_prepare_themes_for_js( $themes = null ) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$update_requires_wp = isset( $updates[ $slug ]['requires'] ) ? $updates[ $slug ]['requires'] : null;
|
||||||
|
$update_requires_php = isset( $updates[ $slug ]['requires_php'] ) ? $updates[ $slug ]['requires_php'] : null;
|
||||||
|
|
||||||
$auto_update = in_array( $slug, $auto_updates, true );
|
$auto_update = in_array( $slug, $auto_updates, true );
|
||||||
$auto_update_action = $auto_update ? 'disable-auto-update' : 'enable-auto-update';
|
$auto_update_action = $auto_update ? 'disable-auto-update' : 'enable-auto-update';
|
||||||
|
|
||||||
$prepared_themes[ $slug ] = array(
|
$prepared_themes[ $slug ] = array(
|
||||||
'id' => $slug,
|
'id' => $slug,
|
||||||
'name' => $theme->display( 'Name' ),
|
'name' => $theme->display( 'Name' ),
|
||||||
'screenshot' => array( $theme->get_screenshot() ), // @todo Multiple screenshots.
|
'screenshot' => array( $theme->get_screenshot() ), // @todo Multiple screenshots.
|
||||||
'description' => $theme->display( 'Description' ),
|
'description' => $theme->display( 'Description' ),
|
||||||
'author' => $theme->display( 'Author', false, true ),
|
'author' => $theme->display( 'Author', false, true ),
|
||||||
'authorAndUri' => $theme->display( 'Author' ),
|
'authorAndUri' => $theme->display( 'Author' ),
|
||||||
'tags' => $theme->display( 'Tags' ),
|
'tags' => $theme->display( 'Tags' ),
|
||||||
'version' => $theme->get( 'Version' ),
|
'version' => $theme->get( 'Version' ),
|
||||||
'compatibleWP' => is_wp_version_compatible( $theme->get( 'RequiresWP' ) ),
|
'compatibleWP' => is_wp_version_compatible( $theme->get( 'RequiresWP' ) ),
|
||||||
'compatiblePHP' => is_php_version_compatible( $theme->get( 'RequiresPHP' ) ),
|
'compatiblePHP' => is_php_version_compatible( $theme->get( 'RequiresPHP' ) ),
|
||||||
'parent' => $parent,
|
'updateResponse' => array(
|
||||||
'active' => $slug === $current_theme,
|
'compatibleWP' => is_wp_version_compatible( $update_requires_wp ),
|
||||||
'hasUpdate' => isset( $updates[ $slug ] ),
|
'compatiblePHP' => is_php_version_compatible( $update_requires_php ),
|
||||||
'hasPackage' => isset( $updates[ $slug ] ) && ! empty( $updates[ $slug ]['package'] ),
|
),
|
||||||
'update' => get_theme_update_available( $theme ),
|
'parent' => $parent,
|
||||||
'autoupdate' => $auto_update,
|
'active' => $slug === $current_theme,
|
||||||
'actions' => array(
|
'hasUpdate' => isset( $updates[ $slug ] ),
|
||||||
|
'hasPackage' => isset( $updates[ $slug ] ) && ! empty( $updates[ $slug ]['package'] ),
|
||||||
|
'update' => get_theme_update_available( $theme ),
|
||||||
|
'autoupdate' => $auto_update,
|
||||||
|
'actions' => array(
|
||||||
'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null,
|
'activate' => current_user_can( 'switch_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=activate&stylesheet=' . $encoded_slug ), 'switch-theme_' . $slug ) : null,
|
||||||
'customize' => $customize_action,
|
'customize' => $customize_action,
|
||||||
'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null,
|
'delete' => current_user_can( 'delete_themes' ) ? wp_nonce_url( admin_url( 'themes.php?action=delete&stylesheet=' . $encoded_slug ), 'delete-theme_' . $slug ) : null,
|
||||||
@ -793,10 +800,68 @@ function customize_themes_print_templates() {
|
|||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<# if ( data.hasUpdate ) { #>
|
<# if ( data.hasUpdate ) { #>
|
||||||
<div class="notice notice-warning notice-alt notice-large" data-slug="{{ data.id }}">
|
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>
|
||||||
<h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
|
<div class="notice notice-warning notice-alt notice-large" data-slug="{{ data.id }}">
|
||||||
{{{ data.update }}}
|
<h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
|
||||||
</div>
|
{{{ data.update }}}
|
||||||
|
</div>
|
||||||
|
<# } else { #>
|
||||||
|
<div class="notice notice-error notice-alt notice-large" data-slug="{{ data.id }}">
|
||||||
|
<h3 class="notice-title"><?php _e( 'Update Incompatible' ); ?></h3>
|
||||||
|
<p>
|
||||||
|
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your versions of WordPress and PHP.' );
|
||||||
|
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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 ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of WordPress.' );
|
||||||
|
if ( current_user_can( 'update_core' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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 ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of PHP.' );
|
||||||
|
if ( current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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>' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<# } #>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<# if ( data.parent ) { #>
|
<# if ( data.parent ) { #>
|
||||||
|
@ -389,13 +389,64 @@ foreach ( $themes as $theme ) :
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if ( $theme['hasUpdate'] ) : ?>
|
<?php if ( $theme['hasUpdate'] ) : ?>
|
||||||
<div class="update-message notice inline notice-warning notice-alt">
|
<?php if ( $theme['updateResponse']['compatibleWP'] && $theme['updateResponse']['compatiblePHP'] ) : ?>
|
||||||
<?php if ( $theme['hasPackage'] ) : ?>
|
<div class="update-message notice inline notice-warning notice-alt"><p>
|
||||||
<p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p>
|
<?php if ( $theme['hasPackage'] ) : ?>
|
||||||
|
<?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?>
|
||||||
|
<?php else : ?>
|
||||||
|
<?php _e( 'New version available.' ); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</p></div>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<p><?php _e( 'New version available.' ); ?></p>
|
<div class="notice inline notice-error notice-alt"><p>
|
||||||
|
<?php
|
||||||
|
if ( $theme['updateResponse']['compatibleWP'] && $theme['updateResponse']['compatiblePHP'] ) {
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your versions of WordPress and PHP.' );
|
||||||
|
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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>' );
|
||||||
|
}
|
||||||
|
} elseif ( ! $theme['updateResponse']['compatibleWP'] ) {
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of WordPress.' );
|
||||||
|
if ( current_user_can( 'update_core' ) ) {
|
||||||
|
printf(
|
||||||
|
/* translators: %s: URL to WordPress Updates screen. */
|
||||||
|
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
|
||||||
|
self_admin_url( 'update-core.php' )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} elseif ( ! $theme['updateResponse']['compatiblePHP'] ) {
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of PHP.' );
|
||||||
|
if ( current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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>' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</p></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@ -659,10 +710,67 @@ function wp_theme_auto_update_setting_template() {
|
|||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<# if ( data.hasUpdate ) { #>
|
<# if ( data.hasUpdate ) { #>
|
||||||
<# if ( data.hasPackage ) { #>
|
<# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #>
|
||||||
<div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p></div>
|
<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>' ); ?>
|
||||||
|
<# } else { #>
|
||||||
|
<?php _e( 'New version available.' ); ?>
|
||||||
|
<# } #>
|
||||||
|
</p></div>
|
||||||
<# } else { #>
|
<# } else { #>
|
||||||
<div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available.' ); ?></p></div>
|
<div class="notice inline notice-error notice-alt"><p>
|
||||||
|
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your versions of WordPress and PHP.' );
|
||||||
|
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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 ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of WordPress.' );
|
||||||
|
if ( current_user_can( 'update_core' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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 ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of PHP.' );
|
||||||
|
if ( current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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>' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<# } #>
|
||||||
|
</p></div>
|
||||||
<# } #>
|
<# } #>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
@ -853,15 +961,73 @@ function wp_theme_auto_update_setting_template() {
|
|||||||
</p></div>
|
</p></div>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<# if ( data.actions.autoupdate ) { #>
|
<# if ( data.hasUpdate ) { #>
|
||||||
<?php echo wp_theme_auto_update_setting_template(); ?>
|
<# 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>
|
||||||
|
{{{ data.update }}}
|
||||||
|
</div>
|
||||||
|
<# } else { #>
|
||||||
|
<div class="notice notice-error notice-alt notice-large">
|
||||||
|
<h3 class="notice-title"><?php _e( 'Update Incompatible' ); ?></h3>
|
||||||
|
<p>
|
||||||
|
<# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your versions of WordPress and PHP.' );
|
||||||
|
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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 ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of WordPress.' );
|
||||||
|
if ( current_user_can( 'update_core' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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 ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of PHP.' );
|
||||||
|
if ( current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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>' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<# } #>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<# if ( data.hasUpdate ) { #>
|
<# if ( data.actions.autoupdate ) { #>
|
||||||
<div class="notice notice-warning notice-alt notice-large">
|
<?php echo wp_theme_auto_update_setting_template(); ?>
|
||||||
<h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
|
|
||||||
{{{ data.update }}}
|
|
||||||
</div>
|
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<p class="theme-description">{{{ data.description }}}</p>
|
<p class="theme-description">{{{ data.description }}}</p>
|
||||||
|
@ -90,21 +90,78 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<# if ( 'installed' === data.theme.type && data.theme.hasUpdate ) { #>
|
<# if ( 'installed' === data.theme.type && data.theme.hasUpdate ) { #>
|
||||||
<div class="update-message notice inline notice-warning notice-alt" data-slug="{{ data.theme.id }}">
|
<# if ( data.theme.updateResponse.compatibleWP && data.theme.updateResponse.compatiblePHP ) { #>
|
||||||
<p>
|
<div class="update-message notice inline notice-warning notice-alt" data-slug="{{ data.theme.id }}">
|
||||||
<?php
|
<p>
|
||||||
if ( is_multisite() ) {
|
<?php
|
||||||
_e( 'New version available.' );
|
if ( is_multisite() ) {
|
||||||
} else {
|
_e( 'New version available.' );
|
||||||
printf(
|
} else {
|
||||||
/* translators: %s: "Update now" button. */
|
printf(
|
||||||
__( 'New version available. %s' ),
|
/* translators: %s: "Update now" button. */
|
||||||
'<button class="button-link update-theme" type="button">' . __( 'Update now' ) . '</button>'
|
__( 'New version available. %s' ),
|
||||||
);
|
'<button class="button-link update-theme" type="button">' . __( 'Update now' ) . '</button>'
|
||||||
}
|
);
|
||||||
?>
|
}
|
||||||
</p>
|
?>
|
||||||
</div>
|
</p>
|
||||||
|
</div>
|
||||||
|
<# } else { #>
|
||||||
|
<div class="update-message notice inline notice-warning notice-alt" data-slug="{{ data.theme.id }}">
|
||||||
|
<p>
|
||||||
|
<# if ( ! data.theme.updateResponse.compatibleWP && ! data.theme.updateResponse.compatiblePHP ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your versions of WordPress and PHP.' );
|
||||||
|
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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.theme.updateResponse.compatibleWP ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of WordPress.' );
|
||||||
|
if ( current_user_can( 'update_core' ) ) {
|
||||||
|
printf(
|
||||||
|
/* translators: %s: URL to WordPress Updates screen. */
|
||||||
|
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
|
||||||
|
self_admin_url( 'update-core.php' )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<# } else if ( ! data.theme.updateResponse.compatiblePHP ) { #>
|
||||||
|
<?php
|
||||||
|
_e( 'There is a new version available, but it doesn’t work with your version of PHP.' );
|
||||||
|
if ( current_user_can( 'update_php' ) ) {
|
||||||
|
printf(
|
||||||
|
/* 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>' );
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<# } #>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<# } #>
|
||||||
<# } #>
|
<# } #>
|
||||||
|
|
||||||
<# if ( ! data.theme.compatibleWP || ! data.theme.compatiblePHP ) { #>
|
<# if ( ! data.theme.compatibleWP || ! data.theme.compatiblePHP ) { #>
|
||||||
|
Loading…
Reference in New Issue
Block a user