[wp-trac] [WordPress Trac] #43960: Support for sorting columns in WP_Privacy_Requests_Table

WordPress Trac noreply at wordpress.org
Sun Jul 15 18:00:56 UTC 2018


#43960: Support for sorting columns in WP_Privacy_Requests_Table
---------------------------------------+-----------------------------
 Reporter:  birgire                    |       Owner:  (none)
     Type:  defect (bug)               |      Status:  new
 Priority:  normal                     |   Milestone:  4.9.8
Component:  Privacy                    |     Version:  trunk
 Severity:  normal                     |  Resolution:
 Keywords:  gdp has-patch 2nd-opinion  |     Focuses:  administration
---------------------------------------+-----------------------------

Comment (by birgire):

 [attachment:"43960.4.diff"]

 - The default sort is {{{Requested (post_date) DESC}}}. First click on
 {{{Requested}}} gives {{{post_date ASC}}}. When other field's sorting is
 active, and we click again on {{{Requested}}} it gives {{{post_date
 DESC}}}. It also respects the search sorting by relevance.
 - Takes the approach from here #32416, regarding the initial order, while
 a more general approach is being worked on here #32170.
 - Adds unit test for the sorting (all passes). We have an abstract class
 {{{WP_Privacy_Requests_Table}}}, so we use same approach as in
 {{{Test_WP_Widget_Media}}} using {{{getMockForAbstractClass()}}}. In the
 tests I had to set the global {{{hook_suffix}}} to handle the screen
 though, as setting it via mocked arguments input didn't seem to work or
 using {{{set_current_screen()}}}.

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


More information about the wp-trac mailing list