bp_settings_get_registered_notification_keys()
Build a dynamic whitelist of notification keys, based on what’s hooked to ‘bp_notification_settings’.
Description
Return
(array)
Source
File: bp-settings/bp-settings-functions.php
function bp_settings_get_registered_notification_keys() { ob_start(); /** * Fires at the start of the notification keys whitelisting. * * @since BuddyPress 1.0.0 */ do_action( 'bp_notification_settings' ); $screen = ob_get_clean(); $matched = preg_match_all( '/<input[^>]+name="notifications\[([^\]]+)\]/', $screen, $matches ); if ( $matched && isset( $matches[1] ) ) { $key_whitelist = $matches[1]; } else { $key_whitelist = array(); } return $key_whitelist; }
Changelog
Version | Description |
---|---|
BuddyPress 2.3.5 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.