rest_get_avatar_urls

Retrieves the avatar urls in various sizes based on a given email address.

Description

(array) rest_get_avatar_urls( (string) $email ); 

Returns (array)

$urls Gravatar url for each size.

Parameters (1)

0. $email (string)
Email address.

Usage

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

Defined (1)

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

/wp-includes/rest-api.php  
  1. function rest_get_avatar_urls( $email ) { 
  2. $avatar_sizes = rest_get_avatar_sizes(); 
  3.  
  4. $urls = array(); 
  5. foreach ( $avatar_sizes as $size ) { 
  6. $urls[ $size ] = get_avatar_url( $email, array( 'size' => $size ) ); 
  7.  
  8. return $urls;