Created
January 29, 2024 14:41
-
-
Save modemlooper/4d73a5eae9e76d91b9538ff37d416b52 to your computer and use it in GitHub Desktop.
Remove BuddyPress no component pages notice
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
/** | |
* 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