TCBarrett

Open Source Architect (Web Geek)

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • WordPress Info
    • WordPress Website
    • How To Get WordPress
  • WordPress Plugins
    • WP Glossary
      • How To Add Glossary Terms
      • Basic Usage Of The Glossary Shortcode
      • How To Make An A to Z Of Glossary Items
      • How To Make A List Of All My Terms
      • How To Turn Off Tooltips
      • How To Create Multiple Glossaries
      • How Do I Enable Comments
  • About Me
    • Open Source Architect
  • Contact
    • Donate
  • Glossary
    • Glossary A to Z
    • Glossary Term List
  • Login

Post navigation

← Previous Next →

Redirect your WordPress users to the dashboard when they log in

Posted on 2012/06/18 (367 days ago) by TCBarrett

A lot of effort goes into making the admin side of WordPress really user-friendly and intuitive. I think that the dashboard is one of the prettiest and most fun admin pages. I also think that the edit profile screen is one of the worst. Additionally, as a developer, I can do lots of stuff with the dashboard, but the user profile is stuck in the dinosaur-like age of AIM (AOL Instant Messenger) and has a horrible set of bordering-on-useless hooks.

The idea that some users get redirected to their profile page instead of the dashboard, based solely on their role, seems like a terrible piece of discrimination to me. The poor things. I would prefer that users are redirected back to the page they logged in from, or failing that, either the dashboard or the site’s homepage.

add_filter( 'login_redirect','tcb_redirect_all_logins_to_dashboard', 10, 3 );
function tcb_redirect_all_logins_to_dashboard( $redirect, $request, $user ){
  return admin_url();
}

It would be easy to expand this to act differently based on user or their role.

Share this:

  • Twitter
  • Google +1
  • Facebook
  • LinkedIn
  • More
  • StumbleUpon
  • Reddit
  • Print
  • Email
  • Digg

Like this:

Like Loading...
This entry was posted in WordPress and tagged Login, wp-admin by TCBarrett. Bookmark the permalink.

Follow me on Twitter

My Tweets

My favourite PAYG SIM

Get a free giffgaff Sim

Random Glossary Term

  • Gravity Forms

ADVERTISEMENT

Proudly powered by WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.
%d bloggers like this: