rest_avatar_sizes WordPress Filter Hook

The `rest_avatar_sizes` filter hook allows you to modify the list of avatar sizes that are available to be used in the WordPress REST API. This can be useful if you want to add or remove avatar sizes for your theme or plugin.

apply_filters( 'rest_avatar_sizes', int[] $sizes ) #

Filters the REST avatar sizes.


Description

Use this filter to adjust the array of sizes returned by the rest_get_avatar_sizes function.


Top ↑

Parameters

$sizes

(int[])An array of int values that are the pixel sizes for avatars. Default [ 24, 48, 96 ].


Top ↑

Source

File: wp-includes/rest-api.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More