Skip to content

Instantly share code, notes, and snippets.

@benschaaf
Created May 31, 2013 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benschaaf/5686755 to your computer and use it in GitHub Desktop.
Save benschaaf/5686755 to your computer and use it in GitHub Desktop.
WordPress ~ Redirect to specific page based on logged in status.
<?php
// Add to theme functions.php
function redirect_gift_registry() {
if (is_user_logged_in() && is_page(2042)) {
wp_redirect( home_url("/shop") ); exit;
}
}
add_action('template_redirect', 'redirect_gift_registry');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment