diff --git a/src/wp-admin/includes/class-custom-background.php b/src/wp-admin/includes/class-custom-background.php index e8aee43c2e..a2be358e77 100644 --- a/src/wp-admin/includes/class-custom-background.php +++ b/src/wp-admin/includes/class-custom-background.php @@ -239,21 +239,24 @@ class Custom_Background {
- - - + wp_admin_notice( + $message, + array( + 'type' => 'info', + 'additional_classes' => array( 'hide-if-no-customize' ), + ) + ); + } + ?> updated ) ) { ?>
'; + $incompatible_notice_message = ''; if ( ! $compatible_php && ! $compatible_wp ) { - _e( 'This plugin does not work with your versions of WordPress and PHP.' ); + $incompatible_notice_message .= __( 'This plugin does not work with your versions of WordPress and PHP.' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { - printf( + $incompatible_notice_message .= sprintf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ ' ' . __( 'Please update WordPress, and then learn more about updating PHP.' ), self_admin_url( 'update-core.php' ), esc_url( wp_get_update_php_url() ) ); - wp_update_php_annotation( '
', '' ); + $incompatible_notice_message .= wp_update_php_annotation( '
', '', false ); } elseif ( current_user_can( 'update_core' ) ) { - printf( + $incompatible_notice_message .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } elseif ( current_user_can( 'update_php' ) ) { - printf( + $incompatible_notice_message .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); - wp_update_php_annotation( '
', '' ); + $incompatible_notice_message .= wp_update_php_annotation( '
', '', false ); } } elseif ( ! $compatible_wp ) { - _e( 'This plugin does not work with your version of WordPress.' ); + $incompatible_notice_message .= __( 'This plugin does not work with your version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { - printf( + $incompatible_notice_message .= printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Please update WordPress.' ), self_admin_url( 'update-core.php' ) ); } } elseif ( ! $compatible_php ) { - _e( 'This plugin does not work with your version of PHP.' ); + $incompatible_notice_message .= __( 'This plugin does not work with your version of PHP.' ); if ( current_user_can( 'update_php' ) ) { - printf( + $incompatible_notice_message .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); - wp_update_php_annotation( '
', '' ); + $incompatible_notice_message .= wp_update_php_annotation( '
', '', false ); } } - echo '
- %s %s', - $url, - $label, - /* translators: Hidden accessibility text. */ - __( '(opens in a new tab)' ) - ); - ?> -
-' . sprintf( $removed, $date ) . '
- unpublished customization changes. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ), - esc_url( - add_query_arg( - 'changeset_uuid', - rawurlencode( get_post_meta( $post_id, '_customize_changeset_uuid', true ) ), - admin_url( 'customize.php' ) - ) - ) - ); - ?> -
-'; - _e( 'Error: This plugin requires a newer version of PHP.' ); + $compatible_php_notice_message = '
'; + $compatible_php_notice_message .= __( 'Error: This plugin requires a newer version of PHP.' ); + if ( current_user_can( 'update_php' ) ) { - printf( + $compatible_php_notice_message .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( 'Click here to learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) - ); - - wp_update_php_annotation( '
', '' ); + ) . wp_update_php_annotation( '
', '', false ); } else { - echo '
'; + $compatible_php_notice_message .= ''; } - echo ''; - _e( 'Warning: This plugin has not been tested with your current version of WordPress.' ); - echo '
'; - _e( 'Error: This plugin requires a newer version of WordPress.' ); + $compatible_wp_notice_message = __( 'Error: This plugin requires a newer version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { - printf( + $compatible_wp_notice_message .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( 'Click here to update WordPress.' ), esc_url( self_admin_url( 'update-core.php' ) ) ); } - echo '
%s
%s
%s', __( 'One or more plugins failed to load properly.' ), __( 'You can find more details and make changes on the Plugins screen.' ), esc_url( admin_url( 'plugins.php?plugin_status=paused' ) ), __( 'Go to the Plugins screen' ) ); + wp_admin_notice( + $message, + array( 'type' => 'error' ) + ); } /** @@ -2571,8 +2575,8 @@ function deactivated_plugins_notice() { ); } - printf( - '
%s
%s
%s', sprintf( /* translators: %s: Name of deactivated plugin. */ __( '%s plugin deactivated during WordPress upgrade.' ), @@ -2582,6 +2586,7 @@ function deactivated_plugins_notice() { esc_url( admin_url( 'plugins.php?plugin_status=inactive' ) ), __( 'Go to the Plugins screen' ) ); + wp_admin_notice( $message, array( 'type' => 'warning' ) ); } // Empty the options. diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php index 0a3699672d..2f28397ec9 100644 --- a/src/wp-admin/includes/template.php +++ b/src/wp-admin/includes/template.php @@ -512,9 +512,16 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
- + ', + array( + 'type' => 'error', + 'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), + 'paragraph_wrap' => false, + ) + ); + ?> @@ -2776,9 +2783,12 @@ function wp_star_rating( $args = array() ) { * @since 4.2.0 */ function _wp_posts_page_notice() { - printf( - '%s
%s
%s
%s
%s
- Exit Recovery Mode' ), - esc_url( $url ) - ); - ?> -
-