Created
August 30, 2019 18:07
-
-
Save kimcoleman/6b3cb2414127d015d23bd1d083ddfa99 to your computer and use it in GitHub Desktop.
Redirect users without access to a single bbPress forum to the Membership Levels 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 | |
/** | |
* Redirect users without access to a single bbPress forum to the Membership Levels page. | |
* | |
*/ | |
function redirect_bbpress_no_access_levels_page( $redirect_to, $forum_id ) { | |
global $pmpro_pages; | |
$redirect_to = get_permalink( $pmpro_pages['levels'] ); | |
return $redirect_to; | |
} | |
add_filter( 'pmprobbp_check_forum_redirect_url', 'redirect_bbpress_no_access_levels_page', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment