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

WordPress Trac noreply at wordpress.org
Thu Feb 15 14:06:31 UTC 2018


#41445: post_parent can prevent media from embedding correctly
-------------------------------------------------+-------------------------
 Reporter:  loboyle                              |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  REST API                             |  Review
 Severity:  normal                               |     Version:  4.9.4
 Keywords:  has-patch needs-testing dev-         |  Resolution:
  feedback                                       |     Focuses:  rest-api
-------------------------------------------------+-------------------------

Comment (by adamsilverstein):

 @stuartfeldt thanks for the patch!

 I have a couple of questions/comments about the code:

 * should we check that $request['id'] available before using?
 * add a query limit to avoid runaway queries
 * you can remove $has_permission entirely: just return true if
 `$this->check_read_permission( $post );` is true
 * similarly, I don't think need to track $wp_error - instead, since you
 could be looking thru multiple posts with the same attached image, you are
 really looking for matches you have access to and can ignore the rest.

 Reviewing the approach I also have two basic architectural concerns:
 * performance impact - meta queries are expensive
 * possible unexpected side effects, eg opening permissions where they
 should not be

 This ticket could use feedback/review from a REST API component maintainer
 about the overall approach. cc: @rmccue @kadamwhite @joehoyle @rachelbaker
 @jnylen0

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


More information about the wp-trac mailing list