- This topic has 2 replies, 2 voices, and was last updated 9 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
WordPress Membership Plugin
Simple Membership Plugin › Forums › Simple Membership Plugin › How to use swpm_after_logout_redirect_url hook
I want the user to be directed to the front end of the site (the home page) after logging out, rather than having the default WordPress logout page shown. But I don’t understand how to code the swpm_after_logout_redirect_url hook in the theme’s function file. Any help please? Thank you.
Never mind. I found the WordPress code to do this.
I am glad you found a solution to your problem. Just in case you did not know, you could try the following function.
You can use the following tweak to do a custom redirection after the logout event. Add the following code to your theme’s functions.php file and that should do the job. This function will allow you to keep this tweak even if you update the plugin.
add_action('swpm_logout', 'my_custom_after_logout_redirection');
function my_custom_after_logout_redirection()
{
$url = 'http://www.example.com/after-logout-page';//TODO - Specify the URL that you want to redirect to
wp_redirect($url);
exit();
}