Skip to content

Instantly share code, notes, and snippets.

@michaelbeil
Forked from MaryOJob/my_logout_go_home.php
Last active January 6, 2023 23:45
Show Gist options
  • Save michaelbeil/7a9fa152ded9f9037e07f55816ca7ffb to your computer and use it in GitHub Desktop.
Save michaelbeil/7a9fa152ded9f9037e07f55816ca7ffb to your computer and use it in GitHub Desktop.
Redirect users to a specified page when logging out of your PMPro site
<?php // DO NOT COPY THIS LINE
//copy lines 5 onwards into your active theme's function.php or custom plugin for code snippets.
function mypmpro_redirect_logout(){
wp_safe_redirect( '/contact/' ); // use this line to redirect to a specific page on your site
}
add_action('wp_logout','mypmpro_redirect_logout');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment