WordPress at a glance
filter is not described

pre_get_avatar filter-hook . WP 4.2.0

Allows the HTML for a user's avatar to be returned early.

Passing a non-null value will effectively short-circuit get_avatar(), passing the value through the 'get_avatar' filter and returning early.


add_filter( 'pre_get_avatar', 'filter_function_name_6195', 10, 3 );
function filter_function_name_6195( $avatar, $id_or_email, $args ){
	// filter...

	return $avatar;
HTML for the user's avatar.
Default: null
The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.
Arguments passed to get_avatar_url(), after processing.

Список изменений

С версии 4.2.0 Введена.

Где вызывается хук

wp-includes/pluggable.php 2674
$avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args );

Где используется хук в ядре WP

Использование не найдено.