WordPress.org

Ready to get started?Download WordPress

Forums

Restricted Site Access
[resolved] Allow access to lost password page using TML (2 posts)

  1. rezon8dev
    Member
    Posted 1 year ago #

    Hi,
    Can you help with the code for my functions.php which will allow a visitor to access the /lost-password page when using the redirect to a specific page option for a registered user protected site? I'm using theme my login and have placed a gravity form for site registration on the TML login page but would ideally like the above code to allow me to add additional pages to the code when I want to allow them to be accessed by a user in addition to my login/register page.

    Thanks!

    http://wordpress.org/extend/plugins/restricted-site-access/

  2. Jake Goldman
    10up Engineer
    Plugin Author

    Posted 1 year ago #

    The 'restricted_site_access_is_restricted' let's you override restriction.

    In this case:

    add_filter( 'restricted_site_access_is_restricted', 'my_restricted_check', 10, 2 );
    
    function my_restricted_check( $is_restricted, $wp ) {
    	if ( false === $is_restricted )
    		return false;
    
    	if ( ! empty( $wp->query_vars['pagename'] ) && $wp->query_vars['pagename'] == 'lost-password' )
    		return false;
    
    	return true;
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic