-
-
Save MaryOJob/92630c34653699982ba8c228419b2219 to your computer and use it in GitHub Desktop.
Redirect users to a specified page when logging out of your WordPress PMPro site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
wp_safe_redirect( home_url() ); // use this to redirect to your website home page | |
exit(); | |
} | |
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