bp_action_variable
Filters the value of a given action variable.
Description
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.
- $action_variable = apply_filters( 'bp_action_variable', $action_variable, $position );
- if ( !empty( $action_variable ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_action_variable callback
- function filter_bp_action_variable( $action_variable, $position ) {
- // make filter magic happen here...
- return $action_variable;
- };
- // add the filter
- add_filter( 'bp_action_variable', 'filter_bp_action_variable', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- return apply_filters( 'bp_action_variable', $action_variable, $position );