[wp-trac] [WordPress Trac] #44219: null post json object reference when retrieve a media item

WordPress Trac noreply at wordpress.org
Thu May 24 18:08:24 UTC 2018


#44219: null post json object reference when retrieve a media item
--------------------------+-----------------------------
 Reporter:  nurcholisart  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.8.2
 Severity:  normal        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 hello, i have problem with my wp json api, and if i'm not wrong, maybe
 this is a bug in wp json api. So, when i try to retrieve a post item, the
 json object show that the post has featured media by id 7636.


 {{{
 {
         // retrieved post item

         "id": 7634,
         "date": "2018-04-16T09:56:54",
         "date_gmt": "2018-04-16T02:56:54",

         ...

         "author": 79,
         "featured_media": 7636,
         "comment_status": "open",
         "ping_status": "open",
         "sticky": false,
         "template": "",
         "format": "standard",
         "meta": [],

         ....
 }
 }}}

 full response here: https://himmahonline.id/wp-json/wp/v2/posts/7634


 But, when i try to retrieve media with id 7636, the "post" json object is
 null. why this is happen? thanks before.

 {{{
 {
         // retrieved media item

         "id": 7636,
         "date": "2018-04-15T17:20:46",
         "date_gmt": "2018-04-15T10:20:46",

         ...

         "post": null,
         "source_url": "https://himmahonline.id/wp-
 content/uploads/2018/04/DSC_0384.jpg",

         ...
 }
 }}}

 full response here: https://himmahonline.id/wp-json/wp/v2/media/7636

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


More information about the wp-trac mailing list