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.
Built from https://develop.svn.wordpress.org/trunk@48092


git-svn-id: http://core.svn.wordpress.org/trunk@47859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2020-06-19 16:51:14 +00:00
parent 019bc2d244
commit aca919f007
6 changed files with 10 additions and 10 deletions

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

@ -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.' ) );

File diff suppressed because one or more lines are too long

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>
'; ';
/** /**

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-alpha-48091'; $wp_version = '5.5-alpha-48092';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.