bp_action_variable

Filters the value of a given action variable.

Description

apply_filters( 'bp_action_variable', (string|bool) $action_variable, (int) $position ); 

Parameters (2)

0. $action_variable (string|bool)
Requested action variable based on position.
1. $position (int)
The key of the action variable requested.

Usage

To run the hook, copy the example below.
  1. $action_variable = apply_filters( 'bp_action_variable', $action_variable, $position ); 
  2.  
  3. if ( !empty( $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_action_variable callback 
  2. function filter_bp_action_variable( $action_variable, $position ) { 
  3. // make filter magic happen here... 
  4. return $action_variable
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_action_variable', 'filter_bp_action_variable', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_action_variable', 'filter_bp_action_variable', 10, 2 ); 

Defined (1)

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

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