Add login_redirect filter. fixes #7002 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@8736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aa37570238
commit
0ee91f227e
|
@ -434,6 +434,8 @@ default:
|
||||||
|
|
||||||
$user = wp_signon('', $secure_cookie);
|
$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 ( !is_wp_error($user) ) {
|
||||||
// If the user can't edit posts, send them to their profile.
|
// 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/' ) )
|
if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
|
||||||
|
|
Loading…
Reference in New Issue