bp_default_component_subnav

Filters the default component subnav item.

Description

apply_filters( 'bp_default_component_subnav', (string) $r_default_subnav_slug, (array) $r ); 

Parameters (2)

0. $r_default_subnav_slug (string)
The slug of the default subnav item to select when clicked.
1. $r (array)
Parsed arguments for the nav item.

Usage

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

Defined (1)

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

/bp-core/bp-core-buddybar.php  
  1. $bp->current_action = apply_filters( 'bp_default_component_subnav', $r['default_subnav_slug'], $r );