[wp-trac] [WordPress Trac] #39092: REST API: Add support for filename search in media endpoint
WordPress Trac
noreply at wordpress.org
Mon Dec 5 22:40:07 UTC 2016
#39092: REST API: Add support for filename search in media endpoint
-------------------------------------------------+-------------------------
Reporter: jblz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: REST API | Review
Severity: normal | Version: trunk
Keywords: has-patch needs-unit-tests needs- | Resolution:
testing | Focuses: rest-api
-------------------------------------------------+-------------------------
Comment (by jnylen0):
Review comments on [attachment:39092.diff]:
Normally we would remove this filter after using it, but
`_filter_query_attachment_filenames` removes itself so we are good there.
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.
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39092#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list