rest_avatar_sizes
Filters the REST avatar sizes.
Use this filter to adjust the array of sizes returned by the rest_get_avatar_sizes function.
Usage
add_filter( 'rest_avatar_sizes', 'wp_kama_rest_avatar_sizes_filter' );
/**
* Function for `rest_avatar_sizes` filter-hook.
*
* @param int[] $sizes An array of int values that are the pixel sizes for avatars.
*
* @return int[]
*/
function wp_kama_rest_avatar_sizes_filter( $sizes ){
// filter...
return $sizes;
}
- $sizes(int[])
- An array of int values that are the pixel sizes for avatars.
Default:[ 24, 48, 96 ]
Changelog
| Since 4.4.0 | Introduced. |
Where the hook is called
rest_avatar_sizes
wp-includes/rest-api.php 1316
return apply_filters( 'rest_avatar_sizes', array( 24, 48, 96 ) );