Created
September 12, 2024 17:03
-
-
Save kimcoleman/1bfbc0f132b0e3bbe045268f59c30474 to your computer and use it in GitHub Desktop.
Remove the restricted messages shown on the /forums/ archive in BuddyBoss.
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 | |
/** | |
* 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