pp_pre_get_avatar

The BP Local Avatars pp pre get avatar function.

Description

pp_pre_get_avatar( $avatar, $id_or_email, $args ); 

Parameters (3)

0. $avatar
The avatar.
1. $id_or_email
The id or email.
2. $args
The args.

Usage

  1. if ( !function_exists( 'pp_pre_get_avatar' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-local-avatars/pp-local-avatars.php'; 
  3.  
  4. // The avatar. 
  5. $avatar = null; 
  6.  
  7. // The id or email. 
  8. $id_or_email = null; 
  9.  
  10. // The args. 
  11. $args = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pp_pre_get_avatar($avatar, $id_or_email, $args); 
  15.  

Defined (1)

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

/pp-local-avatars.php  
  1. function pp_pre_get_avatar( $avatar, $id_or_email, $args ) { 
  2.  
  3. if ( isset( $id_or_email->user_id ) ) { 
  4.  
  5. if ( $id_or_email->user_id === '0' ) { 
  6.  
  7. $default = get_option('avatar_default'); 
  8.  
  9. if( $default == 'identicon_local' ) { 
  10.  
  11. $mystery_man = '<img src="' . site_url() . '/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg" class="avatar user-28-avatar avatar-74 photo" width="74" height="74">'; 
  12.  
  13. $avatar = apply_filters( 'pp_local_avatars_anon', $mystery_man ); 
  14.  
  15.  
  16. return $avatar;