diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 5314f4c9cf..de675959f0 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -3125,11 +3125,11 @@ function do_settings_fields($page, $section) { * @global array $wp_settings_errors Storage array of errors registered during this pageload * * @param string $setting Slug title of the setting to which this error applies - * @param string $id Slug-name to identify the error. Used as part of 'id' attribute in HTML output. + * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output. * @param string $message The formatted message text to display to the user (will be shown inside styled
and

) * @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'. */ -function add_settings_error( $setting, $id, $message, $type = 'error' ) { +function add_settings_error( $setting, $code, $message, $type = 'error' ) { global $wp_settings_errors; if ( !isset($wp_settings_errors) ) @@ -3137,7 +3137,7 @@ function add_settings_error( $setting, $id, $message, $type = 'error' ) { $new_error = array( 'setting' => $setting, - 'title' => $title, // @todo $title not defined. Use $id instead? + 'code' => $code, 'message' => $message, 'type' => $type ); @@ -3225,7 +3225,7 @@ function settings_errors ( $setting = '', $sanitize = FALSE, $hide_on_update = F $output = ''; foreach ( $settings_errors as $key => $details ) { - $css_id = 'setting-error-' . $details['title']; + $css_id = 'setting-error-' . $details['code']; $css_class = $details['type'] . ' fade settings-error'; $output .= "

\n"; $output .= "

{$details['message']}

"; diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 1f3d67dc56..d2400b0445 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2380,9 +2380,9 @@ function sanitize_option($option, $value) { switch ($option) { case 'admin_email': - if ( !$value = sanitize_email($value) && function_exists('add_settings_error') ) + $value = sanitize_email($value); + if ( !$value && function_exists('add_settings_error') ) add_settings_error('admin_email', 'invalid_admin_email', __('The E-Mail Address submitted was not in the right format. Please enter a valid Email Address')); - break; case 'thumbnail_size_w':