CARVIEW |
Select Language
HTTP/2 200
server: nginx
date: Fri, 10 Oct 2025 22:37:03 GMT
content-type: text/html;charset=utf-8
vary: Accept-Encoding
etag: W/"anonymous/Thu, 18 Feb 2010 16:27:56 GMT/False"
cache-control: must-revalidate
expires: Fri, 01 Jan 1999 00:00:00 GMT
alt-svc: h3=":443"; ma=86400
strict-transport-security: max-age=31536000
x-frame-options: SAMEORIGIN
content-encoding: gzip
settings_api_errors_update-13196.diff on Ticket #11474 – Attachment
– WordPress Trac
Ticket #11474: settings_api_errors_update-13196.diff
File settings_api_errors_update-13196.diff, 2.2 KB (added by jeremyclarke, 16 years ago) |
---|
Fix bugs in Settings API Errors patch |
-
wp-admin/includes/template.php
3125 3125 * @global array $wp_settings_errors Storage array of errors registered during this pageload 3126 3126 * 3127 3127 * @param string $setting Slug title of the setting to which this error applies 3128 * @param string $ idSlug-name to identify the error. Used as part of 'id' attribute in HTML output.3128 * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output. 3129 3129 * @param string $message The formatted message text to display to the user (will be shown inside styled <div> and <p>) 3130 3130 * @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'. 3131 3131 */ 3132 function add_settings_error( $setting, $ id, $message, $type = 'error' ) {3132 function add_settings_error( $setting, $code, $message, $type = 'error' ) { 3133 3133 global $wp_settings_errors; 3134 3134 3135 3135 if ( !isset($wp_settings_errors) ) … … 3137 3137 3138 3138 $new_error = array( 3139 3139 'setting' => $setting, 3140 ' title' => $title, // @todo $title not defined. Use $id instead?3140 'code' => $code, 3141 3141 'message' => $message, 3142 3142 'type' => $type 3143 3143 ); … … 3225 3225 3226 3226 $output = ''; 3227 3227 foreach ( $settings_errors as $key => $details ) { 3228 $css_id = 'setting-error-' . $details[' title'];3228 $css_id = 'setting-error-' . $details['code']; 3229 3229 $css_class = $details['type'] . ' fade settings-error'; 3230 3230 $output .= "<div id='$css_id' class='$css_class'> \n"; 3231 3231 $output .= "<p><strong>{$details['message']}</strong></p>"; -
wp-includes/formatting.php
2380 2380 2381 2381 switch ($option) { 2382 2382 case 'admin_email': 2383 if ( !$value = sanitize_email($value) && function_exists('add_settings_error') ) 2383 $value = sanitize_email($value); 2384 if ( !$value && function_exists('add_settings_error') ) 2384 2385 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')); 2385 2386 2386 break; 2387 2387 2388 2388 case 'thumbnail_size_w':