bp_current_component

Return the name of the current component.

Description

(string) bp_current_component(); 

Returns (string)

Component name.


Usage

  1. if ( !function_exists( 'bp_current_component' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_current_component(); 
  7.  

Defined (1)

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

/bp-core/bp-core-template.php  
  1. function bp_current_component() { 
  2. $bp =buddypress); 
  3. $current_component = !empty( $bp->current_component ) 
  4. ? $bp->current_component 
  5. : false; 
  6.  
  7. /** 
  8. * Filters the name of the current component. 
  9. * @since 1.0.0 
  10. * @param string|bool $current_component Current component if available or false. 
  11. */ 
  12. return apply_filters( 'bp_current_component', $current_component );