Filter hook 'get_avatar_data'

in WP Core File wp-includes/link-template.php at line 4582

View Source

get_avatar_data

Filter Hook
Description
Filters the avatar data.

Hook Information

File Location wp-includes/link-template.php View on GitHub
Hook Type Filter
Line Number 4582

Hook Parameters

Type Name Description
array $args Arguments passed to get_avatar_data(), after processing.
mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar SHA-256 or MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.

Usage Examples

Basic Usage
<?php
// Hook into get_avatar_data
add_filter('get_avatar_data', 'my_custom_filter', 10, 2);

function my_custom_filter($args, $id_or_email) {
    // Your custom filtering logic here
    return $args;
}

Source Code Context

wp-includes/link-template.php:4582 - How this hook is used in WordPress core
<?php
4577  	 *
4578  	 * @param array $args        Arguments passed to get_avatar_data(), after processing.
4579  	 * @param mixed $id_or_email The avatar to retrieve. Accepts a user ID, Gravatar SHA-256 or MD5 hash,
4580  	 *                           user email, WP_User object, WP_Post object, or WP_Comment object.
4581  	 */
4582  	return apply_filters( 'get_avatar_data', $args, $id_or_email );
4583  }
4584  
4585  /**
4586   * Retrieves the URL of a file in the theme.
4587   *

PHP Documentation

<?php
/**
	 * Filters the avatar data.
	 *
	 * @since 4.2.0
	 *
	 * @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 SHA-256 or MD5 hash,
	 *                           user email, WP_User object, WP_Post object, or WP_Comment object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/link-template.php
Related Hooks

Related hooks will be displayed here in future updates.