bp_core_avatar_folder_url

Filters the avatar folder directory URL.

Description

apply_filters( 'bp_core_avatar_folder_url', (string) $avatar_loc_url_avatar_loc_dir_params_item_id, (int) $params_item_id, (string) $params_object, (string) $params_avatar_dir ); 

Parameters (4)

0. $avatar_loc_url_avatar_loc_dir_params_item_id (string) => ( $avatar_loc->url . $avatar_loc->dir . $params['item_id'] )
The avatar loc url avatar loc dir params item id.
1. $params_item_id (int)
ID of the avatar item being requested.
2. $params_object (string)
Avatar type being requested.
3. $params_avatar_dir (string)
Subdirectory where the requested avatar should be found.

Usage

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

Defined (1)

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

/bp-core/bp-core-avatars.php  
  1. $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', ( $avatar_loc->url . $avatar_loc->dir . $params['item_id'] ), $params['item_id'], $params['object'], $params['avatar_dir'] );