Wednesday, 22 April 2015

Wordpress admin panel custom landing page after login

Redirect to different landing page after successful login on wordpress admin panel,

/*To make non-admin users redirect to specified landing page*/

function your_login_redirect()
{

if(!is_super_admin()){

            // pick where to redirect to, in the example: Posts page
            return admin_url( 'edit.php' );
        } else {
            return admin_url();
        }
   
}
add_filter( 'login_redirect', 'your_login_redirect');