Skip to content

Instantly share code, notes, and snippets.

@bryanmonzon
Last active August 29, 2015 14:00
Show Gist options
  • Save bryanmonzon/11307029 to your computer and use it in GitHub Desktop.
Save bryanmonzon/11307029 to your computer and use it in GitHub Desktop.
I need to redirect people from a page if they're logged in. I'm not sure if hooking into 'wp' is the best way.
function nam_redirects()
{
if( is_page('register')) {
if( is_user_logged_in() ) {
wp_safe_redirect( '/network' );
}
}
}
add_action( 'wp', 'nam_redirects' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment