rest_get_avatar_sizes() WordPress Function

The rest_get_avatar_sizes() function is used to get the list of available avatar sizes for the WordPress REST API. This function is used to get the list of available avatar sizes for the WordPress REST API. The function returns an array of objects, each of which contains the height and width of an avatar size in pixels.

rest_get_avatar_sizes() #

Retrieves the pixel sizes for avatars.


Return

(int[]) List of pixel sizes for avatars. Default [ 24, 48, 96 ].


Top ↑

Source

File: wp-includes/rest-api.php

function rest_get_avatar_sizes() {
	/**
	 * Filters the REST avatar sizes.
	 *
	 * Use this filter to adjust the array of sizes returned by the
	 * `rest_get_avatar_sizes` function.
	 *
	 * @since 4.4.0
	 *
	 * @param int[] $sizes An array of int values that are the pixel sizes for avatars.
	 *                     Default `[ 24, 48, 96 ]`.
	 */
	return apply_filters( 'rest_avatar_sizes', array( 24, 48, 96 ) );
}


Top ↑

Changelog

Changelog
VersionDescription
4.7.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