bbp_filter_notifications_get_registered_components

Filter registered notifications components, and add 'forums' to the queried 'component_name' array.

Description

(array) bbp_filter_notifications_get_registered_components( (array) $component_names = array() ); 

Returns (array)

Parameters (1)

0. $component_names — Optional. (array) => array()
The component names.

Usage

  1. if ( !function_exists( 'bbp_filter_notifications_get_registered_components' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/extend/buddypress/notifications.php'; 
  3.  
  4. // The component names. 
  5. $component_names = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_filter_notifications_get_registered_components($component_names); 
  9.  

Defined (1)

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

/includes/extend/buddypress/notifications.php  
  1. function bbp_filter_notifications_get_registered_components( $component_names = array() ) { 
  2.  
  3. // Force $component_names to be an array 
  4. if ( ! is_array( $component_names ) ) { 
  5. $component_names = array(); 
  6.  
  7. // Add 'forums' component to registered components array 
  8. array_push( $component_names, bbp_get_component_name() ); 
  9.  
  10. // Return component's with 'forums' appended 
  11. return $component_names;