[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 5 23:23:38 UTC 2021


#53827: Increase number of media items displayed when clicking button to "Load
More"
--------------------------+----------------------------
 Reporter:  antpb         |       Owner:  antpb
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.8.1
Component:  Media         |     Version:  5.8
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  accessibility
--------------------------+----------------------------

Comment (by 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53827#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list