Skip to content

Instantly share code, notes, and snippets.

@davidzack
Last active August 16, 2017 17:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidzack/194f37444c9d68630308ee416381ef61 to your computer and use it in GitHub Desktop.
Save davidzack/194f37444c9d68630308ee416381ef61 to your computer and use it in GitHub Desktop.
function my_page_template_redirect()
{
if( is_front_page() && is_user_logged_in() )
{
global $current_user;
get_currentuserinfo();
$url = add_query_arg( array(
'firstName' => $current_user->user_firstname,
'lastName' => $current_user->user_lastname,
), $url );
return $url; //nope
wp_redirect ($url); //too many redirects...
exit();
}
}
add_action( 'template_redirect', 'my_page_template_redirect' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment