Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login_init () {
- $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
- if ( isset( $_POST['wp-submit'] ) ) {
- $action = 'post-data';
- } else if ( isset( $_GET['reauth'] ) ) {
- $action = 'reauth';
- } else if ( isset($_GET['key']) ) {
- $action = 'resetpass-key';
- }
- else if ( isset($_GET['rp']) ) {
- $action = 'rp';
- }
- if (
- $action == 'post-data' || // don't mess with POST requests
- $action == 'reauth' || // need to reauthorize
- $action == 'resetpass-key' || // password recovery
- $action == 'logout' // user is logging out
- ) {
- return;
- }
- if ( $action != 'rp' && $action != 'lostpassword') {
- wp_redirect( home_url( '/login/' ) );
- exit;
- }
- }
- add_action('login_init', 'login_init');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement