Add login_redirect filter. fixes #7002 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@8736 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-08-26 17:57:03 +00:00
parent 4533de26cf
commit f47f0a2ddd
1 changed files with 2 additions and 0 deletions

View File

@ -434,6 +434,8 @@ default:
$user = wp_signon('', $secure_cookie);
$redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user);
if ( !is_wp_error($user) ) {
// If the user can't edit posts, send them to their profile.
if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )