REST API: Add support for filename search in media endpoint
|Reported by:||jblz||Owned by:||jnylen0|
|Component:||REST API||Keywords:||has-patch has-unit-tests commit fixed-major|
In , 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.
- 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
Change History (23)
- Keywords needs-refresh added
- Milestone changed from Awaiting Review to 4.7.1
- Keywords needs-refresh removed
- Keywords needs-testing removed
- Owner set to jnylen0
- Status changed from new to accepted
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened