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

WordPress Trac noreply at wordpress.org
Thu Nov 12 02:42:09 UTC 2020


#41445: post_parent can prevent media from embedding correctly
-------------------------------------------------+-------------------------
 Reporter:  loboyle                              |       Owner:
                                                 |  adamsilverstein
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Media                                |     Version:  4.9.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing dev-         |     Focuses:  rest-api
  feedback needs-unit-tests                      |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 The `get_post_status()` function accounts for attachments with an
 `inherit` status on trashed and deleted parents:

 * for attachments on trashed posts, it returns the parent's status
 immediately prior to it been trashed: `get_post_meta( $post->post_parent,
 '_wp_trash_meta_status', true )`
 * for attachments on deleted posts, it assumes the attachment has a
 published status

 Could the REST API use `get_post_status()` in the attachment controller
 when determining the permissions?

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


More information about the wp-trac mailing list