Skip to content

Instantly share code, notes, and snippets.

@modemlooper
Created January 29, 2024 14:41
Show Gist options
  • Save modemlooper/4d73a5eae9e76d91b9538ff37d416b52 to your computer and use it in GitHub Desktop.
Save modemlooper/4d73a5eae9e76d91b9538ff37d416b52 to your computer and use it in GitHub Desktop.
Remove BuddyPress no component pages notice
/**
* Remove BP pages nag.
*
* @return void
*/
function appp_remove_bp_pages_notices() {
$notices = buddypress()->admin->notices;
foreach ( $notices as $key => $notice ) {
$message = $notice['message'];
if ( strpos( $message, 'The following active BuddyPress Components do not have associated BuddyPress Pages' ) !== false ) {
unset( buddypress()->admin->notices[ $key ] );
}
}
}
add_action( 'admin_init', 'appp_remove_bp_pages_notices' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment