Created
October 23, 2012 05:01
-
-
Save mattonomics/3936783 to your computer and use it in GitHub Desktop.
P2 Theme Mods
This file contains 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
<?php | |
// find out if they're logged in and send them to the login form if not | |
add_action('template_redirect', 'deny_phonies'); | |
function deny_phonies() { | |
if (!is_user_logged_in() && $GLOBALS['pagenow'] !== 'wp-login.php') { | |
wp_redirect(get_site_url($GLOBALS['blog_id'], 'wp-login.php')); | |
exit; | |
} | |
} | |
// send users to the main site after login | |
add_filter('login_redirect', 'redirect_loggedin_phonies'); | |
function redirect_loggedin_phonies() { | |
return get_site_url(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment