Media: Fix date filter not showing uploads in Media Library
Changes
This PR implements two minimal changes to resolve the issue:
-
Add date filter functions (
src/js/media/models/attachments.js) Addedyearandmonthnumfilter functions to the staticAttachments.filtersobject (lines 598-657). These functions validate attachments against year/month filter criteria -
Updated allowed args whitelist (
src/js/media/models/query.js) Added'year'and'monthnum'to theallowedargs array so Query collections observe the upload queue when date filters are active.
Trac ticket: https://core.trac.wordpress.org/ticket/61057
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.