WordPress.org

Ready to get started?Download WordPress

Forums

redirect after logout (3 posts)

  1. saxamo
    Member
    Posted 4 years ago #

    Hello all,

    I know that modifying core files is a no no, but when you log out of the site I tend to think that most authors are interested in seeing their posts rather then the log in screen.

    Is there any reason in my reading why on line 328 if using notepad++ ( best free editor around IMO ) that we can't change the line from

    $redirect_to = 'wp-login.php?loggedout=true';

    to:

    $redirect_to = 'index.php?loggedout=true';

    and do we need the ?loggedout=true on the end of the index.php? What potential problems other then having to change this each time with updates might occur by making this change?

    Kind regards,
    Saxamo

  2. chocks
    Member
    Posted 4 years ago #

    saxamo, you can use this instead:

    function redirect_logout() {
    		if ( preg_match('#(wp-login.php)?(loggedout=true)#',$_SERVER['REQUEST_URI']))
            wp_redirect(get_option('siteurl'));
    }

    Chocks

  3. tedinoz
    Member
    Posted 4 years ago #

    Or you could use the "From where you came" plugin (http://wordpress.org/support/topic/143646).

    Ted

Topic Closed

This topic has been closed to new replies.

About this Topic