[wp-trac] [WordPress Trac] #50105: Remove infinite scrolling behavior from the Media grid

WordPress Trac noreply at wordpress.org
Mon May 17 11:22:21 UTC 2021


#50105: Remove infinite scrolling behavior from the Media grid
-------------------------------------+-------------------------------------
 Reporter:  afercia                  |       Owner:  joedolson
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  5.8
Component:  Media                    |     Version:
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch has-           |     Focuses:  ui, accessibility,
  screenshots needs-testing early    |  javascript
  commit                             |
-------------------------------------+-------------------------------------

Comment (by spacedmonkey):

 The issue here is the change of the output from the function
 `wp_ajax_query_attachments`

 {{{#!php
         $result = array(
                 'attachments'      => $posts,
                 'totalAttachments' => $query->found_posts,
         );

         wp_send_json_success( $result );

 }}}


 The output admin ajax call is now different. I think changing the format
 of the response here will likely break other plugin as this admin ajax
 call is used in other plugin, not just core. I have used in a couple of
 plugins I have used for clients.

 Instead of changing the output of the admin ajax call, not just use the
 REST API for these views. If you add the _envelope param to the rest api
 call, then you would get the same data. See
 https://make.wordpress.org/core/wp-json/wp/v2/media?_envelope=true

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


More information about the wp-trac mailing list