pre_get_avatar_data хук-фильтр . WP 4.2.0
Filters whether to retrieve the avatar URL early.
Passing a non-null value in the 'url' member of the return array will effectively short circuit get_avatar_data(), passing the value through the 'get_avatar_data' filter and returning early.
Использование
add_filter( 'pre_get_avatar_data', 'filter_function_name_7118', 10, 2 ); function filter_function_name_7118( $args, $id_or_email ){ // filter... return $args; }
- $args(массив)
- Arguments passed to get_avatar_data(), after processing.
- $id_or_email(смешанный)
- The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, user email, WP_User object, WP_Post object, or WP_Comment object.
Список изменений
С версии 4.2.0 | Введена. |
Где вызывается хук
wp-includes/link-template.php 4191
$args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email );