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
314           $user = new WP_User(0, $user_login);
315
316           // If the user can't edit posts, send them to their profile.
317           if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
318                $redirect_to = get_option('siteurl') . '/wp-admin/profile.php';
319
320           if ( wp_login($user_login, $user_pass, $using_cookie) ) {
321                if ( !$using_cookie )
322                     wp_setcookie($user_login, $user_pass, false, '', '', $rememberme);
323                do_action('wp_login', $user_login);
324                wp_redirect($redirect_to);
325                exit();
326           } else {
327                if ( $using_cookie )
328                     $errors['expiredsession'] = __('Your session has expired.');
329           }
330      }
331
332      if ( $_POST && empty( $user_login ) )