bp_is_action_variable

Filters whether the current page matches a given action_variable.

Description

apply_filters( 'bp_is_action_variable', (bool) $is_action_variable, (string) $action_variable, (int) $position ); 

Parameters (3)

0. $is_action_variable (bool)
Whether the current page matches a given action_variable.
1. $action_variable (string)
The action_variable being tested against.
2. $position (int)
The array key tested against.

Usage

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

Defined (1)

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

/bp-core/bp-core-template.php  
  1. return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position );