bp_notifications_get_registered_components

Filters active components with registered notifications callbacks.

Description

apply_filters( 'bp_notifications_get_registered_components', (string) $component_names, (array) $active_components ); 

Parameters (2)

0. $component_names (string)
Array of registered component names.
1. $active_components (array)
Array of active components.

Usage

To run the hook, copy the example below.
  1. $component_names = apply_filters( 'bp_notifications_get_registered_components', $component_names, $active_components ); 
  2.  
  3. if ( !empty( $component_names ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_notifications_get_registered_components callback 
  2. function filter_bp_notifications_get_registered_components( $component_names, $active_components ) { 
  3. // make filter magic happen here... 
  4. return $component_names
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_notifications_get_registered_components', 'filter_bp_notifications_get_registered_components', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_notifications_get_registered_components', 'filter_bp_notifications_get_registered_components', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/bp-notifications/bp-notifications-functions.php  
  1. return apply_filters( 'bp_notifications_get_registered_components', $component_names, $active_components );