Reply To: Login redirect for Admins

Home Forums User Registration Login redirect for Admins Reply To: Login redirect for Admins

#3472

sanjeev3
Member

Hello,

You can use the following code to your child theme’s functions.php

function ur_admin_default_page(  $redirect, $user ) {

	if( current_user_can( 'manage_options' ) ) {	
		return admin_url();
	} else {
		return $redirect;
	}
}

add_filter( 'user_registration_login_redirect', 'ur_admin_default_page', 10, 2 );

Hope this helps!