Changeset 45632
- Timestamp:
- 07/14/2019 02:34:02 PM (5 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api.php
r45566 r45632 1086 1086 1087 1087 /** 1088 * Retrieves the avatar urls in various sizes based on a given email address.1088 * Retrieves the avatar urls in various sizes. 1089 1089 * 1090 1090 * @since 4.7.0 … … 1092 1092 * @see get_avatar_url() 1093 1093 * 1094 * @param string $email Email address. 1094 * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash, 1095 * user email, WP_User object, WP_Post object, or WP_Comment object. 1095 1096 * @return array $urls Gravatar url for each size. 1096 1097 */ 1097 function rest_get_avatar_urls( $ email ) {1098 function rest_get_avatar_urls( $id_or_email ) { 1098 1099 $avatar_sizes = rest_get_avatar_sizes(); 1099 1100 1100 1101 $urls = array(); 1101 1102 foreach ( $avatar_sizes as $size ) { 1102 $urls[ $size ] = get_avatar_url( $ email, array( 'size' => $size ) );1103 $urls[ $size ] = get_avatar_url( $id_or_email, array( 'size' => $size ) ); 1103 1104 } 1104 1105 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r45267 r45632 950 950 951 951 if ( in_array( 'author_avatar_urls', $fields, true ) ) { 952 $data['author_avatar_urls'] = rest_get_avatar_urls( $comment ->comment_author_email);952 $data['author_avatar_urls'] = rest_get_avatar_urls( $comment ); 953 953 } 954 954 -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
r45590 r45632 939 939 940 940 if ( in_array( 'avatar_urls', $fields, true ) ) { 941 $data['avatar_urls'] = rest_get_avatar_urls( $user ->user_email);941 $data['avatar_urls'] = rest_get_avatar_urls( $user ); 942 942 } 943 943
Note: See TracChangeset
for help on using the changeset viewer.