• Resolved Sandra Boulou

    (@debby78018)


    Hi
    I need my visitor to exclude restricted acceess to one page to reset or change their password.
    I see this code but I dont know how to adapt I need my visitor see the profil-membre, what can I do please ?

    add_filter( 'restricted_site_access_is_restricted', 'my_rsa_feed_override', 10, 2 );
    
    function my_rsa_feed_override( $is_restricted, $wp ) {
    	// check query variables to see if this is the feed
    	if ( ! empty( $wp->query_vars['feed'] ) ) {
    		$is_restricted = false;
    	}
    	return $is_restricted;
    }

    Thanks a lot

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Sandra Boulou

    (@debby78018)

    I also try with this but it does not work:

    add_filter( 'restricted_site_access_is_restricted', 'my_rsa_feed_override', 10, 2 );
    
    function my_rsa_feed_override( $is_restricted, $wp ) {
    	// check query variables to see if this is the feed
    	$current_url = trailingslashit( wpmem_current_url( true, false ) ); 
    if( 'https://intranet-lecompagnonnage.fr/profil-membre' == $current_url ) {
    	}
    	return $is_restricted;
    }
    Thread Starter Sandra Boulou

    (@debby78018)

    Your plugin is very usfeful but it is very annoying if we can not exclude one or several pages from the restricted access. For exemple password reset, profil member, create account… I hope there is a solution.
    Thanks

    Plugin Contributor Siddharth Thevaril

    (@nomnom99)

    Hi @debby78018

    Assuming the URL for the member login page is:

    https://intranet-lecompagnonnage.fr/profil-membre

    You can try the following:

    add_filter( 'restricted_site_access_is_restricted', 'exclude_membre_page', 10, 2 );
    function exclude_membre_page( $is_restricted, $wp ) {
        if ( isset( $wp->request ) && 'profil-membre' === $wp->request ) {
            $is_restricted = false;
        }
    
        return $is_restricted;
    }

    Let us know if this works for you.

    Thread Starter Sandra Boulou

    (@debby78018)

    Hi,

    Thanks if insert this code in my functions.php

    I have this error:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘exclude_’ not found or invalid function name in /home/clients/sboulou/prod/intranet/wp-includes/class-wp-hook.php on line 307

    Plugin Contributor Siddharth Thevaril

    (@nomnom99)

    Hi @debby78018 , I’ve updated the code, can you try again?

    Thread Starter Sandra Boulou

    (@debby78018)

    I dont have your code ? thanks

    Thread Starter Sandra Boulou

    (@debby78018)

    Ok I took it and it is ok now, perfect !! if we have another page to exclude what can we do ?

    Plugin Contributor Siddharth Thevaril

    (@nomnom99)

    For multiple pages, you will have to add multiple conditionals similar to:

    if ( isset( $wp->request ) && 'profil-membre' === $wp->request ) {
    	$is_restricted = false;
    }

    where profil-membre will be replaced by the path of the page you want unrestricted.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Exclude restric access for one page’ is closed to new replies.