Support » Plugin: User Registration & User Profile - Profile Builder » How to lock old register / login pages

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @julian25,

    Already answered through our support ticketing system.

    Regards.

    erikggonc

    (@erikggonc)

    Please Georgian @raster02, can you tell us how to do that? I’d like to do that on my site too.

    Thanks in advance!

    • This reply was modified 3 years ago by erikggonc.
    Plugin Author Georgian Cocora

    (@raster02)

    Hello @erikggonc,

    You can do so with the following code. Just make sure to enter the links to your front-end pages at the top:

    function wppbc_free_default_login_redirect() {
    	$login_page = 'LOGIN_PAGE_URL';
    	$register_page ='REGISTER_PAGE_URL';
    	$password_recovery_page = 'PASSWORD_RECOVERY_PAGE_URL';
    
    	$page = basename($_SERVER['REQUEST_URI']);
    
    	if( $page == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {
    		wp_redirect($login_page);
    		exit;
    	}
    	else if ($page == "wp-login.php?action=register") {
    		wp_redirect($register_page);
    		exit;
    	}
    	else if ($page == "wp-login.php?action=lostpassword") {
    		wp_redirect($password_recovery_page);
    		exit;
    	}
    }
    add_action('init','wppbc_free_default_login_redirect');

    You can add this in the functions.php file of your theme.

    Regards.

    erikggonc

    (@erikggonc)

    Thank you so much, Georgian!!! My best wishes for you!

    Hello Georgian @raster02, how are you?

    After a few months using the plugin without any problems, a doubt came up, and it became a necessity.

    When a user sends incorrect or blank login information, is it possible to redirect him back to the login page of the plugin instead of the wp-login.php page?

    Is it possible to supplement the above script?

    Thank you very much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to lock old register / login pages’ is closed to new replies.