Make WordPress Core

Changeset 6987


Ignore:
Timestamp:
02/22/2008 10:07:53 PM (17 years ago)
Author:
ryan
Message:

Show messages with message styling instead of error styling. fixes #5929

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r6922 r6987  
    3636
    3737    if ( $wp_error->get_error_code() ) {
    38         $errors = "\n";
    39         foreach ( $wp_error->get_error_messages() as $error )
    40             $errors .= '    ' . $error . "<br />\n";
    41 
    42         echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
     38        $errors = '';
     39        $messages = '';
     40        foreach ( $wp_error->get_error_codes() as $code ) {
     41            $severity = $wp_error->get_error_data($code);
     42            foreach ( $wp_error->get_error_messages($code) as $error ) {
     43                if ( 'message' == $severity )
     44                    $messages .= '  ' . $error . "<br />\n";
     45                else
     46                    $errors .= '    ' . $error . "<br />\n";
     47            }
     48        }
     49        if ( !empty($errors) )
     50            echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
     51        if ( !empty($messages) )
     52            echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
    4353    }
    4454} // End of login_header()
     
    350360
    351361    // Some parts of this script use the main login form to display a message
    352     if      ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )         $errors->add('loggedout', __('You are now logged out.'));
     362    if      ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )         $errors->add('loggedout', __('You are now logged out.'), 'message');
    353363    elseif  ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] ) $errors->add('registerdiabled', __('User registration is currently not allowed.'));
    354     elseif  ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )  $errors->add('confirm', __('Check your e-mail for the confirmation link.'));
    355     elseif  ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )  $errors->add('newpass', __('Check your e-mail for your new password.'));
    356     elseif  ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )   $errors->add('registered', __('Registration complete. Please check your e-mail.'));
     364    elseif  ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )  $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
     365    elseif  ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )  $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
     366    elseif  ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )   $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
    357367
    358368    login_header(__('Login'), '', $errors);
Note: See TracChangeset for help on using the changeset viewer.