Make WordPress Core

Changeset 13197


Ignore:
Timestamp:
02/18/2010 07:43:44 PM (14 years ago)
Author:
ryan
Message:

add_settings_error fixes. Props jeremyclarke. fixes #11474

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r13177 r13197  
    31263126 *
    31273127 * @param string $setting Slug title of the setting to which this error applies
    3128  * @param string $id Slug-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.
    31293129 * @param string $message The formatted message text to display to the user (will be shown inside styled <div> and <p>)
    31303130 * @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'.
    31313131 */
    3132 function add_settings_error( $setting, $id, $message, $type = 'error' ) {
     3132function add_settings_error( $setting, $code, $message, $type = 'error' ) {
    31333133    global $wp_settings_errors;
    31343134
     
    31383138    $new_error = array(
    31393139        'setting' => $setting,
    3140         'title' => $title, // @todo $title not defined. Use $id instead?
     3140        'code' => $code,
    31413141        'message' => $message,
    31423142        'type' => $type
     
    32263226    $output = '';
    32273227    foreach ( $settings_errors as $key => $details ) {
    3228         $css_id = 'setting-error-' . $details['title'];
     3228        $css_id = 'setting-error-' . $details['code'];
    32293229        $css_class = $details['type'] . ' fade settings-error';
    32303230        $output .= "<div id='$css_id' class='$css_class'> \n";
  • trunk/wp-includes/formatting.php

    r13177 r13197  
    23812381    switch ($option) {
    23822382        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') )
    23842385                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 
    23862386            break;
    23872387
Note: See TracChangeset for help on using the changeset viewer.