Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimcoleman/6b3cb2414127d015d23bd1d083ddfa99 to your computer and use it in GitHub Desktop.
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.
<?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