Make WordPress Core


Ignore:
Timestamp:
07/14/2019 02:34:02 PM (7 years ago)
Author:
SergeyBiryukov
Message:

REST API: Allow rest_get_avatar_urls() to accept full user, post, or comment objects, rather than just an email address, to provide better flexibility for alternative avatar data.

Since the function uses get_avatar_url() internally, which already supports it, this should not have any backward compatibility concerns.

Props donmhico, dshanske, pputzer, joehoyle, TimothyBlynJacobs.
Fixes #40030.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r45267 r45632  
    950950
    951951                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 );
    953953                }
    954954
Note: See TracChangeset for help on using the changeset viewer.