Created
November 20, 2020 16:53
-
-
Save dparker1005/736eaed08ed895ab29f951ab0861db5c to your computer and use it in GitHub Desktop.
Redirect logout to PMPro login page.
This file contains 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 | |
// Copy from below here... | |
/* | |
* Redirect logout to PMPro login page. | |
*/ | |
function my_logout_url_redirect_pmpro( $logout_url ) { | |
global $pmpro_pages; | |
if ( ! empty( $pmpro_pages['login'] ) ) { | |
$logout_url .= '&redirect_to=' . urlencode( get_permalink( $pmpro_pages['login'] ) ); | |
} | |
return $logout_url; | |
} | |
add_filter( 'logout_url', 'my_logout_url_redirect_pmpro' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment