Forked from dparker1005/logout_url_redirect_pmpro.php
Created
September 14, 2023 19:01
-
-
Save JarrydLong/6cd849bcfa95962f1b98dc321b83c529 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