Title: rest_get_avatar_sizes
Published: December 7, 2016
Last modified: May 20, 2026

---

# rest_get_avatar_sizes(): int[]

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#wp--skip-link--target)

Retrieves the pixel sizes for avatars.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#return)󠁿

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

## 󠀁[Source](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#source)󠁿

    ```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 ) );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api.php#L1308)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api.php#L1308-L1321)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#hooks)󠁿

 [apply_filters( ‘rest_avatar_sizes’, int[] $sizes )](https://developer.wordpress.org/reference/hooks/rest_avatar_sizes/)

Filters the REST avatar sizes.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#related)󠁿

| Uses | Description | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [rest_get_avatar_urls()](https://developer.wordpress.org/reference/functions/rest_get_avatar_urls/)`wp-includes/rest-api.php` |

Retrieves the avatar URLs in various sizes.

  | 
| [WP_REST_Users_Controller::get_item_schema()](https://developer.wordpress.org/reference/classes/wp_rest_users_controller/get_item_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php` |

Retrieves the user’s schema, conforming to JSON Schema.

  | 
| [WP_REST_Comments_Controller::get_item_schema()](https://developer.wordpress.org/reference/classes/wp_rest_comments_controller/get_item_schema/)`wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php` |

Retrieves the comment’s schema, conforming to JSON Schema.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/rest_get_avatar_sizes/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Frest_get_avatar_sizes%2F)
before being able to contribute a note or feedback.