Skip to content

trepmal.com

  • Home
  • Plugins
  • Github
  • Me on WP.org
  • Donate

Categories

  • WordPress Bits (149)
  • Uncategorized (11)
  • Scripts (5)
  • Tidbits (5)
  • Fun (3)

Tags

  • wordpress (30)
  • administration (16)
  • plugin (9)
  • free download (8)
  • functions.php (8)

Year

  • 2018 (8)
  • 2016 (2)
  • 2015 (4)
  • 2014 (19)
  • 2013 (11)

Function: admin_url

Redirect Users at Login

Sometimes, it might be necessary to redirect users to some page other than the dashboard. In the example below, users are redirected to their profile page when they log in.

add_filter( 'login_redirect', 'redirect_to_profile', 10, 2 );
function redirect_to_profile( $redirect_to, $user ) {
    return admin_url('profile.php');
}
Posted on March 23, 2011March 1, 2012Categories WordPress BitsTags log in, redirectLeave a comment on Redirect Users at Login
Proudly powered by WordPress