[wp-trac] [WordPress Trac] #39092: REST API: Add support for filename search in media endpoint
WordPress Trac
noreply at wordpress.org
Mon Dec 5 21:33:32 UTC 2016
#39092: REST API: Add support for filename search in media endpoint
-------------------------+-----------------------------
Reporter: jblz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: trunk
Severity: normal | Keywords:
Focuses: rest-api |
-------------------------+-----------------------------
In [38625], the functionality to search for attachments by filename was
added via the `_filter_query_attachment_filenames` function and exposed
via the `query-attachments` AJAX action.
This applies the same filter function in the same manner in the REST API
`/media` endpoint.
It was necessary to move `_filter_query_attachment_filenames` from `wp-
admin/post.php` to `wp-includes/post.php` as the function did not exist in
the context of a REST API call to that endpoint.
To test:
* Change the `Title` of an attachment to something other than a filename.
* Attempt to search for the filename via the `media?search=`... endpoint
-- notice it doesn't surface the intended result
* Apply patch
* Repeat the search call -- it should surface the intended result
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39092>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list