Skip to content

Instantly share code, notes, and snippets.

@ingozoell
Created May 7, 2014 17:17
Show Gist options
  • Save ingozoell/8d5333ce89af2b117f68 to your computer and use it in GitHub Desktop.
Save ingozoell/8d5333ce89af2b117f68 to your computer and use it in GitHub Desktop.
WordPress User login
function redirect_demo_on_role() {
global $current_user;
get_currentuserinfo();
if( $current_user->user_login == 'demo' OR
$current_user->user_login == 'user.xyz' ) {
{
wp_redirect('http://ingozoell.de/portfolio/'); exit;
}}
}
add_action('admin_init','redirect_demo_on_role');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment