Viewing 1 replies (of 1 total)
  • Plugin Contributor Siddharth Thevaril

    (@nomnom99)

    Hi @debby78018

    Apologies for the delay.

    Please test the following code snippet on a staging environment before running it on a production/live site just to be safe.

    add_filter( 'login_redirect', 'debby_redirect_to_home_after_login', 10, 3 );
    function debby_redirect_to_home_after_login( $redirect_to, $requested_redirect_to, $user ) {
    
    	$path = wp_parse_url( $requested_redirect_to, PHP_URL_PATH );
    
    	if ( empty( $path ) ) {
    		return $redirect_to;
    	}
    
    	$path = trailingslashit( $path );
    
    	if ( '/connexion/' === $path ) {
    		return get_home_url();
    	}
    	
    	return $redirect_to;
    }

    Let us know if this works.

Viewing 1 replies (of 1 total)
  • The topic ‘restricted site access redirection after login’ is closed to new replies.