[wp-trac] [WordPress Trac] #39092: REST API: Add support for filename search in media endpoint

WordPress Trac noreply at wordpress.org
Tue Dec 6 04:40:44 UTC 2016


#39092: REST API: Add support for filename search in media endpoint
-------------------------------------------------+-------------------------
 Reporter:  jblz                                 |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  4.7.1
Component:  REST API                             |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:  rest-api
  testing needs-refresh                          |
-------------------------------------------------+-------------------------

Comment (by jblz):

 Replying to [comment:3 jnylen0]:
 > There's an extra SQL clause added in [attachment:39092.diff].  `OR
 sq1.meta_key = '_wp_attachment_image_alt'  )` -- this could be a good
 enhancement also, but it needs to be a separate ticket.

 Ya, whoops! I was testing out the #39004 patch & missed reverting that bit
 before making this patch. Good catch!

 Thanks for taking a look & for linking to that ticket, @joemcgill. Much
 appreciated.

 > Finally we need to only run this code for the `attachment` post type.
 The new `add_filter` call should go in
 `WP_REST_Attachments_Controller->prepare_items_query` instead.

 That makes sense to me.  I'll see about an updated patch with some tests
 :)

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


More information about the wp-trac mailing list