bp_settings_get_registered_notification_keys()

Build a dynamic list of allowed notification keys, based on what’s hooked to ‘bp_notification_settings’.


Return Return

(array)


Source Source

File: bp-settings/bp-settings-functions.php

function bp_settings_get_registered_notification_keys() {

	ob_start();
	/**
	 * Fires at the start of the building of the notification keys allowed list.
	 *
	 * @since 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] ) ) {
		$allowed_key_list = $matches[1];
	} else {
		$allowed_key_list = array();
	}

	return $allowed_key_list;
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.3.5 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.