Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimcoleman/1bfbc0f132b0e3bbe045268f59c30474 to your computer and use it in GitHub Desktop.
Save kimcoleman/1bfbc0f132b0e3bbe045268f59c30474 to your computer and use it in GitHub Desktop.
Remove the restricted messages shown on the /forums/ archive in BuddyBoss.
<?php
/**
* Remove the restricted messages shown on the /forums/ archive in BuddyBoss.
* BuddyBoss is running the /forums/ page content through the the_content filter, which detects protected forums within the loop.
*/
function my_pmpro_remove_no_access_message_from_bbp_is_forum_archive( $text ) {
// Check if we are on the homepage.
if ( function_exists( 'bbp_is_forum_archive' ) && bbp_is_forum_archive() ) {
// Return an empty string.
return '';
}
// Otherwise, return the default no access message.
return $text;
}
add_filter( 'pmpro_no_access_message_html', 'my_pmpro_remove_no_access_message_from_bbp_is_forum_archive', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment