rest_get_avatar_sizes

Retrieves the pixel sizes for avatars.

Description

(array) rest_get_avatar_sizes(); 

Returns (array)

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


Usage

  1. if ( !function_exists( 'rest_get_avatar_sizes' ) ) { 
  2. require_once ABSPATH . WPINC . '/rest-api.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = rest_get_avatar_sizes(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/rest-api.php  
  1. function rest_get_avatar_sizes() { 
  2. /** 
  3. * Filter the REST avatar sizes. 
  4. * Use this filter to adjust the array of sizes returned by the 
  5. * `rest_get_avatar_sizes` function. 
  6. * @since 4.4.0 
  7. * @param array $sizes An array of int values that are the pixel sizes for avatars. 
  8. * Default `[ 24, 48, 96 ]`. 
  9. */ 
  10. return apply_filters( 'rest_avatar_sizes', array( 24, 48, 96 ) );