[wp-trac] [WordPress Trac] #53827: Increase number of media items displayed when clicking button to "Load More"
WordPress Trac
noreply at wordpress.org
Thu Aug 12 05:50:42 UTC 2021
#53827: Increase number of media items displayed when clicking button to "Load
More"
-------------------------+----------------------------
Reporter: antpb | Owner: antpb
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.8.1
Component: Media | Version: 5.8
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: accessibility
-------------------------+----------------------------
Comment (by antpb):
Replying to [comment:10 peterwilsoncc]:
> I've noticed the default value is hard coded in the
[https://github.com/WordPress/wordpress-
develop/blob/master/src/js/media/models/query.js#L170-L175 JavaScript
default options] without an filter.
>
> I think allowing devs to filter this would be appreciated, is it
possible to either:
>
> * use [https://developer.wordpress.org/block-editor/reference-
guides/packages/packages-hooks/ @wordpress/hooks] to add a filter in
JavaScript
> * cease sending the default value and setting it in
`wp_ajax_query_attachments()` so developers can set the default value in
PHP? The filter `ajax_query_attachments_args` already exists but sending
the requested arguments as a second parameter would probably be needed so
devs can figure out if the value in `$query` is the default or coming from
the ajax request.
I think this is a great idea. We may want to reserve it for a separate
ticket to handle the filter as this issue is aiming to be added in the
next minor release. I could be wrong, but I believe we cannot add new
filters unless in a major point release. Happy to add that to the scope of
this ticket if I'm wrong! :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53827#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list