[wp-trac] [WordPress Trac] #44025: Privacy: Pagination screen options for the requests list tables

WordPress Trac noreply at wordpress.org
Tue Jul 10 21:55:49 UTC 2018


#44025: Privacy: Pagination screen options for the requests list tables
-------------------------------------------------+-------------------------
 Reporter:  birgire                              |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  4.9.8
Component:  Privacy                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-screenshots has-patch needs-     |     Focuses:
  testing                                        |  administration
-------------------------------------------------+-------------------------

Comment (by pbiron):

 Replying to [comment:15 desrosj]:
 > [attachment:"44025.1.diff"] tests well for me! Few small points before I
 think it can be considered ready:
 >
 > - The `@since` tag needs to be changed to `4.9.8`.

 oops!

 > - `get_current_screen()` can return `null` if the `$current_screen`
 global is not set. Looking at other classes that extend `WP_List_Table`,
 they utilize the `$screen` property of `WP_List_Table`. This may be a
 better option as it takes a few extra steps to ensure that property has a
 value.

 Unfortunately, the `WP_Privacy_Requests_Table` isn't yet instantiated when
 `_wp_privacy_requests_screen_options()` is called so using its `$screen`
 property isn't an option.

 As far as I can tell, `get_current_screen()` returning `null` is a non-
 issue since `set_current_screen()` is called
 ([[https://core.trac.wordpress.org/browser/trunk/src/wp-
 admin/admin.php#L203|/wp-admin/admin.php#L203]]) just before `do_action(
 "load-{$page_hook}" );`
 ([[https://core.trac.wordpress.org/browser/trunk/src/wp-
 admin/admin.php#L228|/wp-admin/admin.php#L228]]), which is what causes
 `_wp_privacy_requests_screen_options()` to be called.

 I'll refresh the patch with the correct `@since 4.9.8` once someone else
 confirms my sense on `get_current_screen()` being safe to call.

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


More information about the wp-trac mailing list