Home > multisite > Redirect users on logout

Redirect users on logout

January 31Hits:0
Advertisement

Have multisite set up and would like to redirect users on logout to the root site home page. I know there has to be an answer for this. But I can't find it! driving me batty;-) Any help greatly appreciated.

Answers

you can use wp_logout_url( $redirect); as Pippin sugested if you are echoing out the logout link and if you need it for the built-in logout link on the backend you can use:

//function to redirect after logout
function logout_redirect765(){
  wp_redirect( home_url() );
  exit;
}

//hook function  to wp_logout action
add_action('wp_logout','logout_redirect765');

use wp_logout_url( $redirect ); $redirect is the url for them to be redirected to.

You can probably accomplish what you need to with wp_logout_url( $redirect ). I'd try replacing the logout link in your theme's template files with something like this:

<a href="<?php echo wp_logout_url( network_home_url() ); ?>" title="Logout">Logout</a>

There's not a codex page for network_home_url(), but there is one for home_url(), and it mentions using network_home_url() for a multisite install.

Related Articles

  • Redirect users on logoutJanuary 31

    Have multisite set up and would like to redirect users on logout to the root site home page. I know there has to be an answer for this. But I can't find it! driving me batty;-) Any help greatly appreciated. --------------Solutions------------- you ca

  • Redirect user after logoutJanuary 2

    I am trying to create an unsubscribe page for my members, but in order to see the unsubscribe form, they have to be logged out, so the first link is: /wp-login.php?action=logout&_wpnonce=ba51bbcdc3. Once they are logged out, I need them redirected to

  • wp_logout_url($redirect) won't logout and redirect ()March 27

    Even that I got the code from the wp docs <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Logout</a> This is the output when user clicks on it: Warning: Cannot modify header information - head

  • How to display message after a redirect on the page user/logout?August 28

    I'd like to show a message via drupal_set_message() after redirect a user to page the user/logout?destination=user. I tested this code but it doesn't work: if($find){ drupal_set_message(t('This entry is ignored.'), 'error'); $form_state['redirect'] =

  • Inactivity logout javascript file not working on sharepoint server February 14

    How to log off the SharePoint site, if the user is has been inactive for for 20 minutes? Do I need to redirect user to logout page? How would I count the idle time? --------------Solutions------------- You could count the idle time and redirect to si

  • Logout inactivity javascript file not working February 14

    How to log off the SharePoint site, if the user is has been inactive for for 20 minutes? Do I need to redirect user to logout page? How would I count the idle time? --------------Solutions------------- You could count the idle time and redirect to si

  • wp_logout logging everyone out instead of just the user that clicked the logout link!September 26

    I want to display a different menu depending whether a user is logged into the CMS or not. I'm using this for my menu: <?php if ( is_user_logged_in() ) { $args = array( 'depth' => 1, 'show_date' => '', 'date_format' => get_option('date_format'

  • Blocks not shown in /user/logout pageNovember 24

    Users must be logged in to see anything on my site; so it's important the user login block is always shown to anonymous users. When users log out, they are normally redirected to the front page. A user has reported an issue where this doesn't happen;

  • Need Immediate Roaming Profile / Folder Redirection file save with RDS Farm Windows Server 2008August 26

    I have roaming profiles set up with additional folder redirection deployed by GPO in a 2008 R2 RDS farm environment. They are working well, but files added to folder locations in the profile (such as saving a file to the desktop) only replicate to th

  • Redirect to custom URL after registering from a page with registration formJanuary 20

    I have this form in a page template <form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post"> <div class="formrow requiredRow"><label id="FullName-ariaLabel&q

  • wp_logout_url($redirect); is not working in wordpressOctober 16

    I am writing a simple WP plugin that could log the user in and out. As far as login is concerned its working good but I cannot log out, through my plugin. Logout doesn't work after I login. I have tried a lot of suggested solutions but none of them w

  • Laravel unexpected redirects ( 302 )January 26

    I have started a new Laravel 5.2 project, using laravel new MyApp, and added authentication via php artisan make:auth. This is intended to be a members only website, where the first user is seeded, and creates the rest (no manual user creation/passwo

  • Node Express - res.redirect() not behaving as expectedFebruary 17

    I am trying to redirect to a login page after successfully logging a user out, but am having an issue when calling res.redirect() from my logout route handler in express. I have the following middleware to redirect a user to a login page (note I am u

  • Authentication with Windows LIve ID issuesOctober 2

    I am trying to sutup the Authentication with Windows LIve ID and followed this blog post ,everything is working but I have a problem logging in to live INT web site. Whenever I try to log in (https://login.live-int.com/login.srf) , after entering val

  • Can a user with a disabled account browse Confluence content anonymously?February 2

    I'm running Confluence 3.5.13. I've got SSO authentication against our Active Directory forest working using the NTLMv2 plugin from TechTime. Users with an active account in Confluence are logged in automatically, and users with no account can browse

  • How to log off user from SharePoint site, if the user has been inactive for 20 minutesFebruary 14

    How to log off the SharePoint site, if the user is has been inactive for for 20 minutes? Do I need to redirect user to logout page? How would I count the idle time? --------------Solutions------------- You could count the idle time and redirect to si

  • A Simple CMS in Sinatra, Part III

    A Simple CMS in Sinatra, Part IIIAugust 22

    A Simple CMS in Sinatra A Simple Content Management System in Sinatra A Simple CMS in Sinatra, Part II A Simple CMS in Sinatra, Part III In part two of this tutorial series we finished putting together the basics of our Simple Content Management Syst

  • ISPConfig 3.0.0.8 RC1 released

    ISPConfig 3.0.0.8 RC1 releasedAugust 31

    ISPConfig 3.0.0.8 RC1 is available for download. This release is the first release candidate for the upcoming ISPConfig 3.0.1 final. ISPConfig 3 is a new Hosting Control Panel rewritten from scratch. ISPConfig 3 is not a direct update for ISPConfig 2

  • Apache Directives ProblemsOctober 7

    Hi Till and Falko, I have found some problem in the administration panel. When I try to write some custom directives in the box at the end of the page and then I look the the /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf, the file doesn't respect the

  • Why konqueror does not support autocomplete="off"?June 10

    I am using Konqueror as web browser. I installied it in Ubuntu with the following command: sudo apt-get install konqueror. I want to set in an input autocomplete="off" but it does not work. Is this a bug? or there is any configuration option for

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.513 s.