get_avatar_data

get_avatar_data

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.1

apply_filters('get_avatar_data') is found 3 times:

  • /wp-includes/link-template.php line 4484
    	$args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email );
    
    	if ( isset( $args['url'] ) ) {
    		/** This filter is documented in wp-includes/link-template.php */
    		return apply_filters( 'get_avatar_data', $args, $id_or_email );
    	}
    
    	$email_hash = '';
    	$user       = false;
    	$email      = false;
    
    
  • /wp-includes/link-template.php line 4516
    	} elseif ( $id_or_email instanceof WP_Comment ) {
    		if ( ! is_avatar_comment_type( get_comment_type( $id_or_email ) ) ) {
    			$args['url'] = false;
    			/** This filter is documented in wp-includes/link-template.php */
    			return apply_filters( 'get_avatar_data', $args, $id_or_email );
    		}
    
    		if ( ! empty( $id_or_email->user_id ) ) {
    			$user = get_user_by( 'id', (int) $id_or_email->user_id );
    		}
    		if ( ( ! $user || is_wp_error( $user ) ) && ! empty( $id_or_email->comment_author_email ) ) {
    
  • /wp-includes/link-template.php line 4582
    	 * @param array $args        Arguments passed to get_avatar_data(), after processing.
    	 * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar MD5 hash,
    	 *                           user email, WP_User object, WP_Post object, or WP_Comment object.
    	 */
    	return apply_filters( 'get_avatar_data', $args, $id_or_email );
    }
    
    /**
     * Retrieves the URL of a file in the theme.
     *
     * Searches in the stylesheet directory before the template directory so themes