mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
Administration: Adjust [45814] to address a backward compatibility issue for plugins passing multiple CSS classes to add_settings_error()
.
Only add the `notice-` prefix for `error`, `success`, `warning`, `info` CSS classes, keep other classes as is. Add unit tests for `settings_errors()`. Props afercia, SergeyBiryukov. Fixes #44941. Built from https://develop.svn.wordpress.org/trunk@45873 git-svn-id: http://core.svn.wordpress.org/trunk@45684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
36b4debdb4
commit
f6fc8025c4
@ -1814,13 +1814,17 @@ function settings_errors( $setting = '', $sanitize = false, $hide_on_update = fa
|
||||
$details['type'] = 'success';
|
||||
}
|
||||
|
||||
if ( in_array( $details['type'], array( 'error', 'success', 'warning', 'info' ) ) ) {
|
||||
$details['type'] = 'notice-' . $details['type'];
|
||||
}
|
||||
|
||||
$css_id = sprintf(
|
||||
'setting-error-%s',
|
||||
sanitize_html_class( $details['code'] )
|
||||
esc_attr( $details['code'] )
|
||||
);
|
||||
$css_class = sprintf(
|
||||
'notice notice-%s settings-error is-dismissible',
|
||||
sanitize_html_class( $details['type'] )
|
||||
'notice %s settings-error is-dismissible',
|
||||
esc_attr( $details['type'] )
|
||||
);
|
||||
|
||||
$output .= "<div id='$css_id' class='$css_class'> \n";
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.3-alpha-45872';
|
||||
$wp_version = '5.3-alpha-45873';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user