I have a link in my WP website Account link. I would like this to work normally for logged out users. However for Logged-in users i would like this link to take them to another page url.
I have tried:
function my_logged_in_redirect_sub() {
if ( is_user_logged_in() &&($_GET['account'] )
) {
wp_redirect( get_permalink( 15498 ) );//the redirect page id
die;
}
}
add_action( 'template_redirect', 'my_logged_in_redirect_sub' );
The $_GET['url'] doesn't work
Question: How can i target a specific URL with PHP?