WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin From Where You Came ] - redirect after login or logout (7 posts)

  1. MichaelH
    Member
    Posted 6 years ago #

    Simple, easy, new plugin to redirect you to where you were when you logged in or out.

    Download at http://files.viper007bond.com/wordpress/fromwhereyoucame.zip

    Plugin Name:  From Where You Came
    Version:      1.0.0
    Description:  Makes the "Login" and "Logout" links take you back from where you came.
    Author:       Viper007Bond
    Author URI:   http://www.viper007bond.com/
    
    add_filter( 'loginout', 'fromwhereyoucame' );
    
    function fromwhereyoucame( $link ) {
    	$currenturl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    
    	if ( !is_user_logged_in() )
    		$link = str_replace( '">', '?redirect_to=' . urlencode( $currenturl ) . '">', $link );
    	else
    		$link = str_replace( '">', '&redirect_to=' . urlencode( $currenturl ) . '">', $link );
    
    	return $link;
    }
    
    ?>
  2. Clicknathan
    Member
    Posted 6 years ago #

    Wicked.

    Any chance you'd know how to make this work for WP 2.0.4?

  3. educationthemes
    Member
    Posted 5 years ago #

    Can't get that one to work. I have download, unzipped and upoaded to the wp-content/plugins and then activated. But it always take we to the dashboard when logged in no matter where i came from? Any ideas?

  4. rumbaya
    Member
    Posted 5 years ago #

    Exactly what i was looking for, works perfectly with WordPress 2.6. Thanks!

  5. jossi
    Member
    Posted 5 years ago #

    does not work for me either, and I am using WP 2.6

    ??

  6. maidanet
    Member
    Posted 5 years ago #

    Thank you so much! It works for me and I am using WP 2.6.1

  7. Dgold
    Member
    Posted 5 years ago #

    Works for me in preliminary testing.
    Thanks!

    I'm using this plugin hand-in-hand with TDO Mini Forms plugin. That lets me put a "Write Post" area with custom fields, in a public part of the website (I have a Page called Submit A Post). It only shows up for Subscribers+ (Members), and asks non-logged-in people to Register or Login. Then it shows the "Write Post" within my site design. Now using fromwhereyoucame plugin the user is directed right back to the Submit A Post page, instead of to the Dashvegas.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic