Last active
August 16, 2017 17:21
-
-
Save davidzack/194f37444c9d68630308ee416381ef61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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