[wp-trac] [WordPress Trac] #39805: Expose featured_media property on post resources in "embed" context

WordPress Trac noreply at wordpress.org
Tue Feb 7 20:03:53 UTC 2017


#39805: Expose featured_media property on post resources in "embed" context
-------------------------+------------------------------
 Reporter:  kadamwhite   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  REST API     |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------------------

Comment (by jnylen0):

 I wonder why the `embed` context is such a small subset of data compared
 to `view`?  There are other elements which could potentially be useful.

 Some feedback on the tests - I would test that there are no extra keys,
 rather than just no missing keys:

 {{{#!php
 <?php
 $expected_keys = array( ... );
 $actual_keys = array_keys( $data );
 sort( $actual_keys );
 $this->assertEquals( $expected_keys, $actual_keys );
 }}}

 It may also be worth using a [https://phpunit.de/manual/current/en
 /writing-tests-for-phpunit.html#writing-tests-for-phpunit.data-providers
 data provider] here to cut down on boilerplate.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39805#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list