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

WordPress Trac noreply at wordpress.org
Thu Dec 8 14:37:25 UTC 2016


#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        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 Previously in the JSON response from querying wp-json/wp/v2/media, the
 description field contained the textual description as entered in the
 relevant field within WP-Admin Media Library.


 {{{
 "description":"Site Banner"
 }}}


 Now it returns a render.


 {{{
 "description":{"rendered":"<p class=\"attachment\"><a
 href='http:\/\/www.accordmat.org.uk\/wp\/wp-content\/uploads\/2016\/12
 \/site-banner.jpg'><img width=\"300\" height=\"138\"
 src=\"http:\/\/www.accordmat.org.uk\/wp\/wp-content\/uploads\/2016\/12
 \/site-banner-300x138.jpg\" class=\"attachment-medium size-medium\"
 alt=\"Accord MAT Site Banner\" srcset=\"http:\/\/www.accordmat.org.uk\/wp
 \/wp-content\/uploads\/2016\/12\/site-banner-300x138.jpg 300w,
 http:\/\/www.accordmat.org.uk\/wp\/wp-content\/uploads\/2016\/12\/site-
 banner-768x354.jpg 768w, http:\/\/www.accordmat.org.uk\/wp\/wp-
 content\/uploads\/2016\/12\/site-banner-1024x472.jpg 1024w\" sizes=\"(max-
 width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Site Banner<\/p>\n”}
 }}}


 Whilst I understand that this is to keep consistency with other endpoints,
 I would EXPECT the content of a media description (such as my example
 above) render to contain:


 {{{
 "description":{"rendered":"<p>Site Banner<\/p>\n"}
 }}}

 Including the media itself as an attachment doesn't really comply with the
 idea of a piece of media's '''description'''.

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


More information about the wp-trac mailing list