bp_activity_set_<scope>_scope_args

Plugins can hook here to set their activity arguments for custom scopes.

Description

apply_filters( 'bp_activity_set_<scope>_scope_args', (array) $array, (array) $r ); 

This is a dynamic filter based on the activity scope. eg: - bp_activity_set_groups_scope_args - bp_activity_set_friends_scope_args

To see how this filter is used, plugin devs should check out: - bp_groups_filter_activity_scope() - used for groups scope - bp_friends_filter_activity_scope() - used for friends scope

Parameters (2)

0. $array — Optional. (array) => array()
for more details. }
1. $r (array)
Current activity arguments passed in BP_Activity_Activity::get().

Usage

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

Defined (1)

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

/bp-activity/classes/class-bp-activity-activity.php  
  1. $scope_args = apply_filters( "bp_activity_set_{$scope}_scope_args", array(), $r );