Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    you can play with the following code:

    Open wp-content/plugins/wps-hide-login/wps-hide-login.php an look for this (line 390):

    			if ( is_admin() && ! is_user_logged_in() && ! defined( 'DOING_AJAX' ) && $pagenow !== 'admin-post.php' ) {
                    wp_die( __( 'This has been disabled', 'wps-hide-login' ), 403 );
    			}

    change it with:

    			if ( is_admin() && ! is_user_logged_in() ) {
    				wp_redirect(home_url() . '/error?m=' . urlencode($message));
    				exit();
    			}

    Hmm, I tried this but it doesn’t seem to work?

    It seems to be written to only redirect people who are the admin? I added an ‘!’ before ‘is_admin()’ and it seems to work now.

    final code:

    if ( ! is_admin() && ! is_user_logged_in() ) {
    				wp_redirect(home_url() . '/error?m=' . urlencode($message));
    				exit();
    			}
    • This reply was modified 8 years, 2 months ago by lacoder.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘redirect page’ is closed to new replies.