Support » Plugin: Restricted Site Access » Make exception for password recovery link

  • Hello and thank you for this great plugin. I have this plugin paired with User registration. So far it works great, but I have a problem that the password recovery link is not working.

    I use this code in my functions.php to enable 3 pages – “my-account” – (User control panel), “login” – (my login page) and “privacy” – (GDPR and stuff).

    add_filter( 'restricted_site_access_is_restricted', function( $is_restricted, $wp ) {
    	if( 'my-account' === $wp->request ) {
    		return false;
    	}
    	return $is_restricted;
    }, 10, 2 );

    Now the password recovery link is using this syntax
    https://<website>/my-account?action=rp&key=<key>&login=<UserID>

    Unfortunately this link is getting caught by Restricted Site Access and redirected to login page. Could you help me how to write an exception that could let this link pass through without opening the whole site? Thanks.

    • This topic was modified 8 months, 1 week ago by medard22.
    • This topic was modified 8 months, 1 week ago by medard22.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Tung Du

    (@dinhtungdu)

    Hi @medard22,

    You can try var_dump the $wp object (inside the filter callback) to see its value when you load the password recovery link, from there you’ll know which properties to use to catch that link :).

    Hope this help!

    Thank you for your reply. Unfortunately I really don´t know how to do that 😀 I am no programmer. I will try to read up on this subject though.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Make exception for password recovery link’ is closed to new replies.