[wp-trac] [WordPress Trac] #43699: if i remove image from a post > wp-json return it again as a media

WordPress Trac noreply at wordpress.org
Thu Apr 5 15:04:21 UTC 2018


#43699: if i remove image from a post >  wp-json return it again as a media
--------------------------+-----------------------------
 Reporter:  adalenv       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.9.4
 Severity:  normal        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 i got this response from

 wp-json/wp/v2/media?parent=7 but i have deleted image from post and from
 media:


 {{{
 [
     {
         "id": 19,
         "date": "2018-04-04T09:16:41",
         "date_gmt": "2018-04-04T09:16:41",
         "guid": {
             "rendered": "http://example.com/wp-
 content/uploads/2018/04/a5d13887-7884-4b2b-b7fc-
 efa111e2b024_image5667478565766995646.png"
         },
         "modified": "2018-04-04T09:16:41",
         "modified_gmt": "2018-04-04T09:16:41",
         "slug": "a5d13887-7884-4b2b-b7fc-
 efa111e2b024_image5667478565766995646",
         "status": "inherit",
         "type": "attachment",
         "link": "http://example.com/2018/04/04/lorem-ipsum-dolor-sit-amet-
 consectetur-adipisicing-elit-minus-dicta-ad-explicabo-ipsa-repellat-atque-
 dolore-voluptatibus-doloribus-a-molestias/a5d13887-7884-4b2b-b7fc-
 efa111e2b024_image5667478565766995646/",
         "title": {
             "rendered": "a5d13887-7884-4b2b-b7fc-
 efa111e2b024_image5667478565766995646"
         },
         "author": 1,
         "comment_status": "open",
         "ping_status": "closed",
         "template": "",
         "meta": [],
         "description": {
             "rendered": "<p class=\"attachment\"><a
 href='http://example.com/wp-content/uploads/2018/04/a5d13887-7884-4b2b-
 b7fc-efa111e2b024_image5667478565766995646.png'><img width=\"75\"
 height=\"17\" src=\"http://example.com/wp-
 content/uploads/2018/04/a5d13887-7884-4b2b-b7fc-
 efa111e2b024_image5667478565766995646.png\" class=\"attachment-medium
 size-medium\" alt=\"\" /></a></p>\n"
         },
         "caption": {
             "rendered": ""
         },
         "alt_text": "",
         "media_type": "image",
         "mime_type": "image/png",
         "media_details": {
             "width": 75,
             "height": 17,
             "file": "2018/04/a5d13887-7884-4b2b-b7fc-
 efa111e2b024_image5667478565766995646.png",
             "sizes": {},
             "image_meta": {
                 "aperture": "0",
                 "credit": "",
                 "camera": "",
                 "caption": "",
                 "created_timestamp": "0",
                 "copyright": "",
                 "focal_length": "0",
                 "iso": "0",
                 "shutter_speed": "0",
                 "title": "",
                 "orientation": "0",
                 "keywords": []
             }
         },
         "post": 17,
         "source_url": "http://example.com/wp-
 content/uploads/2018/04/a5d13887-7884-4b2b-b7fc-
 efa111e2b024_image5667478565766995646.png",
         "_links": {
             "self": [
                 {
                     "href": "http://example.com/wp-json/wp/v2/media/19"
                 }
             ],
             "collection": [
                 {
                     "href": "http://example.com/wp-json/wp/v2/media"
                 }
             ],
             "about": [
                 {
                     "href": "http://example.com/wp-
 json/wp/v2/types/attachment"
                 }
             ],
             "author": [
                 {
                     "embeddable": true,
                     "href": "http://example.com/wp-json/wp/v2/users/1"
                 }
             ],
             "replies": [
                 {
                     "embeddable": true,
                     "href": "http://example.com/wp-
 json/wp/v2/comments?post=19"
                 }
             ]
         }
     }
 ]
 }}}

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


More information about the wp-trac mailing list