Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When you login to the admin you see the Welcome page by default. A client of mine requested to see the "Pages" page by default, he had seen it somewhere else.

Is this possible, and if so, how? Tried searching but found nothing relevant, didn't find it in the settings either.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

This should work for you if you put it in your themes functions.php file, but you may want to modify the conditions, and the url to redirect to depending on your set up.

function loginRedirect( $redirect_to, $request, $user ){
    if( is_array( $user->roles ) ) { // check if user has a role
        return "/wp-admin/edit.php?post_type=page";
    }
}
add_filter("login_redirect", "loginRedirect", 10, 3);

Here's a link containing more info about using the login_redirect filter: http://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect

There's also a few login redirect plugins floating around if you do a google search.

share|improve this answer
    
What's the $request for? I don't see where it's used. I removed it and it seems to work, thanks! –  qwerty Oct 24 '12 at 7:14
    
You probably don't really need it, but it is for checking the url that the user is coming from. –  Ben Oct 24 '12 at 17:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.