Skip to:
Content
Pages
Categories
Search
Top
Bottom

Redirection using the logon shortcode

  • @ajtruckle

    Participant

    If I attach a redirect_to parameter to the wp-login.php it will redirect to the topic.

    But if I use my custom logon page that uses the defined shortcode it will not redirect. It seems the query parameters are stripped.

    Please advise.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @robin-w

    Moderator

    try this

    function rew_login_redirect_url ($redirect) {
    	//quit if it's not a redirect
    	if (strpos($_SERVER['REQUEST_URI'], '?redirect_to=') == false ) return $redirect;
    	$redirect = 'url' ;
    	
    	return $redirect ;
    }
    
    add_filter ('bbp_user_login_redirect_to' , 'rew_login_redirect_url', 5 , 1) ;

    change ‘url’ to where you want it to go

    Put this in your child theme’s function file – or use

    Code Snippets

    @ajtruckle

    Participant

    Thanks. I am putting this on hold for the moment. If you look here:

    https://stackoverflow.com/questions/58735124/how-to-redirect-with-existing-url-query-parameters-when-clicking-submit-on-a-c

    You will see that I seemed to have found a bug where the / is one character instead of 2. Either wai, it also seems that there is something that needs looking at with the bbpns notify nospam plugin. I will update you when we make progress.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar