Plugins and Themes Auto-Updates:

- Fix displaying of errors on the Themes screen.
- Correct the classes used for the error messages, and use `notice-alt` as notices are mostly shown on a white background.

Props afercia, azaozz.
Fixes #50405.

git-svn-id: https://develop.svn.wordpress.org/trunk@48092 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2020-06-19 16:49:58 +00:00
parent 65bc801eba
commit 52ce85d0a5
4 changed files with 8 additions and 8 deletions

View File

@ -2719,7 +2719,7 @@
} }
// Clear any previous errors. // Clear any previous errors.
$parent.find( '.notice.error' ).addClass( 'hidden' ); $parent.find( '.notice.notice-error' ).addClass( 'hidden' );
// Show loading status. // Show loading status.
if ( 'enable' === action ) { if ( 'enable' === action ) {
@ -2752,7 +2752,7 @@
errorMessage = __( 'The request could not be completed.' ); errorMessage = __( 'The request could not be completed.' );
} }
$parent.find( '.notice.error' ).removeClass( 'hidden' ).find( 'p' ).text( errorMessage ); $parent.find( '.notice.notice-error' ).removeClass( 'hidden' ).find( 'p' ).text( errorMessage );
wp.a11y.speak( errorMessage, 'polite' ); wp.a11y.speak( errorMessage, 'polite' );
return; return;
} }
@ -2808,7 +2808,7 @@
$document.trigger( 'wp-auto-update-setting-changed', { state: action, type: type, asset: asset } ); $document.trigger( 'wp-auto-update-setting-changed', { state: action, type: type, asset: asset } );
} ) } )
.fail( function() { .fail( function() {
$parent.find( '.notice.error' ) $parent.find( '.notice.notice-error' )
.removeClass( 'hidden' ) .removeClass( 'hidden' )
.find( 'p' ) .find( 'p' )
.text( __( 'The request could not be completed.' ) ); .text( __( 'The request could not be completed.' ) );

View File

@ -775,7 +775,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
*/ */
echo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme ); echo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme );
echo '<div class="auto-updates-error inline notice error hidden"><p></p></div>'; echo '<div class="notice notice-error notice-alt inline hidden"><p></p></div>';
} }
/** /**

View File

@ -1096,7 +1096,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
*/ */
echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data ); echo apply_filters( 'plugin_auto_update_setting_html', $html, $plugin_file, $plugin_data );
echo '<div class="inline notice error hidden"><p></p></div>'; echo '<div class="notice notice-error notice-alt inline hidden"><p></p></div>';
echo '</td>'; echo '</td>';
break; break;

View File

@ -559,7 +559,7 @@ if ( ! is_multisite() && $broken_themes ) {
*/ */
function wp_theme_auto_update_setting_template() { function wp_theme_auto_update_setting_template() {
$template = ' $template = '
<p class="theme-autoupdate"> <div class="theme-autoupdate">
<# if ( data.autoupdate ) { #> <# if ( data.autoupdate ) { #>
<a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable"> <a href="{{{ data.actions.autoupdate }}}" class="toggle-auto-update" data-slug="{{ data.id }}" data-wp-action="disable">
<span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span> <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span>
@ -579,8 +579,8 @@ function wp_theme_auto_update_setting_template() {
<# } #> <# } #>
<br />' . wp_get_auto_update_message() . '</span> <br />' . wp_get_auto_update_message() . '</span>
<# } #> <# } #>
<span class="auto-updates-error hidden"><p></p></span> <div class="notice notice-error notice-alt inline hidden"><p></p></div>
</p> </div>
'; ';
/** /**