Created
October 19, 2012 16:02
-
-
Save maor/3919023 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
<?php | |
/* Plugin Name: P2 Force Login | |
* Description: Force logged-out users to log-in in order to view the P2 | |
* Author: Maor Chasen | |
* Author URI: http://maorchasen.com/ | |
* Version: 1.0 | |
*/ | |
function p2fl_force_login() { | |
is_user_logged_in() || auth_redirect(); | |
} | |
add_action( 'parse_request', 'p2fl_force_login', 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment