Support » Plugin: Peter's Login Redirect » Is this possible?

Viewing 1 replies (of 1 total)
  • A separate page would be the simpler approach. But here’s a way to do it with a JavaScript alert box (taken from this approach).

    Add a trigger to a logout rule like this:

    [variable]siteurl[/variable]?loggedout=true

    and add this to your theme’s functions.php:

    function plr_logout_alert()
    {
      if( 'true' == $_GET['loggedout'] )
      {
        echo '<script>alert("You have been logged out.");</script>';
      }
    }
    add_action( 'init', 'plr_logout_alert' );

    The downsides are
    (1) the user will see mysite.com?loggedout=true in the address bar, and
    (2) the page is not displayed until they dismiss the alert box.

    There are more advanced ways of passing messages onto the next page – let me know if you’re interested and I’ll cook something up.

Viewing 1 replies (of 1 total)
  • The topic ‘Is this possible?’ is closed to new replies.