[wp-trac] [WordPress Trac] #41445: post_parent can prevent media from embedding correctly

WordPress Trac noreply at wordpress.org
Wed Jul 26 06:29:30 UTC 2017


#41445: post_parent can prevent media from embedding correctly
--------------------------+-----------------------------
 Reporter:  loboyle       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.7.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If media is uploaded for a post, then used as a featured image on another
 post, and the original parent is not accessible via the REST API (e.g.
 because it's in the trash, not published etc), then it cannot be embedded
 on the post that ''is'' accessible.

 To reproduce

 * make a new post with a featured image
 * trash the post
 * make a new post, using the first image as the featured image
 * request the second post over the rest API with media embedding enabled

 The media will not be embedded, instead a forbidden result will be
 embedded error

 {{{#!json
 {
   "wp:featuredmedia":[
      {
         "code":"rest_forbidden",
         "message":"You don't have permission to do this.",
         "data":{
            "status":403
         }
      }
   ]
 }
 }}}

 See https://github.com/WP-API/WP-API/issues/2596 for the original issue.
 Also related is https://core.trac.wordpress.org/ticket/30691.

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


More information about the wp-trac mailing list