Forked from JarrydLong/logout_url_redirect_pmpro.php
Last active
June 26, 2025 18:00
-
-
Save kimwhite/f234e432c1e712c7d2cb4ac0d73c9143 to your computer and use it in GitHub Desktop.
Redirect logout to PMPro login page.
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 | |
// Copy from below here... | |
/* | |
* Redirect logout to custom page with slug 'logout'. | |
*/ | |
function my_logout_url_redirect_custom( $logout_url ) { | |
$redirect_url = home_url( '/logout/' ); // Adjust slug if needed | |
$logout_url = add_query_arg( 'redirect_to', urlencode( $redirect_url ), $logout_url ); | |
return $logout_url; | |
} | |
add_filter( 'logout_url', 'my_logout_url_redirect_custom' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment