bp_core_avatar_folder_dir

Filters the avatar folder directory path.

Description

apply_filters( 'bp_core_avatar_folder_dir', (string) $dirname, (unknown) $args_item_id, (unknown) $args_object, (unknown) $args_avatar_dir ); 

Parameters (4)

0. $dirname (string) => dirname( $absolute_path )
The dirname.
1. $args_item_id (unknown)
The args item id.
2. $args_object (unknown)
The args object.
3. $args_avatar_dir (unknown)
The args avatar dir.

Usage

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

Defined (5)

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

/bp-core/classes/class-bp-attachment-avatar.php  
  1. $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $absolute_path ), $args['item_id'], $args['object'], $args['avatar_dir'] ); 
  1. $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $this->upload_path . '/' . $args['avatar_dir'] . '/' . $args['item_id'], $args['item_id'], $args['object'], $args['avatar_dir'] ); 
/bp-core/bp-core-avatars.php  
  1. $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', ( $avatar_loc->path . $avatar_loc->dir . $params['item_id'] ), $params['item_id'], $params['object'], $params['avatar_dir'] ); 
  1. $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 
  1. $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $avatar_dir . '/' . $item_id, $item_id, 'user', 'avatars' );