[wp-trac] [WordPress Trac] #39185: REST API Media end-point, "description" field changes with WP 4.7

WordPress Trac noreply at wordpress.org
Sat Jan 7 20:28:00 UTC 2017


#39185: REST API Media end-point, "description" field changes with WP 4.7
--------------------------+------------------------------
 Reporter:  patchworkboy  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  rest-api
--------------------------+------------------------------

Comment (by jnylen0):

 This is a bit of a weird one.  The media `description` is stored
 internally as the `post_content`, and WP uses the content rendering
 filters to render the attachment image on the original page, which is why
 it shows up there in the API.

 See #38679 for the original change - these fields were pretty broken
 before it.

 I would've liked to make the description of media items appear as you
 suggested, and add a `content: { rendered: ... }` field that contains the
 image display HTML, but we didn't have time.  I also don't love the idea
 of calling it `content` because that means something else for other post
 types.

 We might be able to get something like this done in 4.7.2, but we would
 need consensus on an approach and a patch with unit tests.

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


More information about the wp-trac mailing list