Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_login

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
192           $user = new WP_User(0, $user_login);
193      
194           // If the user can't edit posts, send them to their profile.
195           if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
196                $redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
197      
198           if ( wp_login($user_login, $user_pass, $using_cookie) ) {
199                if ( !$using_cookie )
200                     wp_setcookie($user_login, $user_pass, false, '', '', $rememberme);
201                do_action('wp_login', $user_login);
202                wp_redirect($redirect_to);
203                exit;
204           } else {
205                if ( $using_cookie )               
206                     $error = __('Your session has expired.');
207           }
208      }
209 ?>
210 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">