Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Collins Agbonghama

    (@collizo4sky)

    Hi, leaving the option to ‘default’ will cause users to be redirected to homepage after logout.

    Sorry, you can’t specify a custom url to redirect to after logout at this time.

    For your sake, i will add a filter that you can hook up to and specify a custom redirect.

    Keep an eye on a new plugin release.

    Thread Starter vipin.vishwakarma

    (@vipinvishwakarma-1)

    Hi,

    Thanks for your reply. according to you ‘default’ option will redirect to homepage but unfortunately it is not acting like that.

    Can you please give me answer of my 3rd point regards to validation. I am waiting.

    Thanks
    Regard Vipin Vishwakarma

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    Regarding your 3rd question, remove the “required” attribute in the website shortcode field.

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    Version 1.0.7 just ship.

    To specify a custom logout url, see the code below

    add_filter( 'pp_logout_redirect', 'vipin_logout_redirect' );
    
    function vipin_logout_redirect( $url ) {
    	$url = 'https://url-here';
    
    	return $url;
    }
    Thread Starter vipin.vishwakarma

    (@vipinvishwakarma-1)

    Hi,

    Thank you very much for your support and also for quick turnaround. It would be more helpful for me if you explain that where and in which file exactly the code should be place.

    Thanks
    Regard Vipin Vishwakarma

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    Place the code in your theme’s function.php file.

    Thread Starter vipin.vishwakarma

    (@vipinvishwakarma-1)

    Hi,

    I want to let you know that you are code is awesome. love it and i also generate code for after login with the help of your code.

    add_filter( 'pp_login_redirect', 'vipin_login_redirect' );
    
    function vipin_login_redirect( $url ) {
    	$url = 'https://url-here';
    
    	return $url;
    }

    Thank you very much again!!!!
    Regard Vipin Vishwakarma

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    To sake thank you to us, leave us a review https://www.ads-software.com/support/view/plugin-reviews/ppress?filter=5

    That will be very much appreciated.

    hi,
    i want to add new field in registration form to how i add new field, please suggest me.

    Thanks & Regards,
    kamal chouhan

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    Hi kamalc1436, it is only possible in the premium version of the plugin. click this link to buy https://profilepress.net/pricing/

    Hi,

    Thank you very much for your support.
    Thanks & Regard
    kamal chouhan

    hi,
    i want to remove validation or website field in registration form. how can remove id.

    Thanks & Regards,
    kamal chouhan

    hi Collizo4sky

    sorry for jumping in here, but i do have the exact same issue.
    i do have several logins and logouts with multiple user roles, plus my site is multilangual, so i NEED to set different redirects.

    easiest for me would be, to disable the redirect rules from this plugin, since i use wp_logout_url() and i can set all i want in there. but if i do, your redirect rule hooks in there an places the ‘redirect_to’ at the end, no matter, if it is already there. and since its the last rule, it will be used. any chance to disable that functionality or filter the links for if redirect already exists..?

    and a little honey at the end: looks really promissing, still not done with my development, but looks like this tool does all the aweseomeness, i reuqire.. thanks for making this happen..

    well.. how about this..?
    in class.alter-default-links.php

    find

    public function logout_url_func( $logout_url, $redirect ) {
    		if ( isset( $this->db_settings_data['set_log_out_url'] ) ) {
    			$db_logout_url = get_permalink( absint( $this->db_settings_data['set_log_out_url'] ) );
    
    			if ( empty( $db_logout_url ) || $db_logout_url == 'current_view_page' ) {
    
    				// make redirect currently viewed page
    				$set_redirect = esc_url( get_permalink() );
    			}
    			else {
    				$set_redirect = $db_logout_url;
    			}
    
    			$set_redirect = apply_filters('pp_logout_redirect', $set_redirect);
    
    			return add_query_arg( 'redirect_to', $set_redirect, $logout_url );
    		}
    	}

    replace

    public function logout_url_func( $logout_url, $redirect ) {
    		if ( isset( $this->db_settings_data['set_log_out_url'] ) ) {
    			$db_logout_url = get_permalink( absint( $this->db_settings_data['set_log_out_url'] ) );
    
    			if ( empty( $db_logout_url ) || $db_logout_url == 'current_view_page' ) {
    
    				// make redirect currently viewed page
    				$set_redirect = esc_url( get_permalink() );
    			}
    			else {
    				$set_redirect = $db_logout_url;
    			}
    
    			$set_redirect = apply_filters('pp_logout_redirect', $set_redirect);
    
    			if ( strpos( $logout_url, '&redirect_to=' ) !== false ) {
    				return $logout_url;
    			} else {
    				return add_query_arg( 'redirect_to', $set_redirect, $logout_url );
    			}
    		}
    	}

    what do you think..?
    please note: the if ( strpos( $logout_url, '&redirect_to=' )
    should NOT include & but & amp ;
    dunno if the &redirect_to= should only read redirect_to, but this works and also requiress the & and = character to be present.. mabe more bulletproof..

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    Instead of the code above, why not hook into pp_logout_redirect and specify the url the user will be redirected to after logout.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Redirect after logout and login’ is closed to new replies.