[wp-trac] [WordPress Trac] #43895: Organize privacy functions into logical files and classes

WordPress Trac noreply at wordpress.org
Sun May 26 01:15:03 UTC 2019


#43895: Organize privacy functions into logical files and classes
-------------------------------------------+-----------------------
 Reporter:  iandunn                        |       Owner:  desrosj
     Type:  enhancement                    |      Status:  assigned
 Priority:  normal                         |   Milestone:  5.3
Component:  Privacy                        |     Version:  4.9.6
 Severity:  normal                         |  Resolution:
 Keywords:  early has-patch needs-testing  |     Focuses:
-------------------------------------------+-----------------------

Comment (by birgire):

 This looks good.

 Maybe it's better to have as few as possible to modify and upload such a
 large patch, to minimize possible related problems :-)

 So I don't upload a modified patch for now :-)

 Few things I noticed when testing [attachment:"43895.2.diff"]:

 We need to remove:

 {{{
 <input type="hidden" name="page" value="export_personal_data" />

 }}}

 from

 {{{
 src/wp-admin/export-personal-data.php
 }}}

 and

 {{{
 <input type="hidden" name="page" value="remove_personal_data" />

 }}}

 from

 {{{
 src/wp-admin/erase-personal-data.php
 }}}


 to have the request search working again.

 Then we need to add

 {{{
 // Add screen options.
 _wp_privacy_requests_screen_options();
 }}}

 above

 {{{
 // Handle list table actions.
 _wp_personal_data_handle_actions();
 }}}

 in both {{{src/wp-admin/export-personal-data.php}}} and {{{src/wp-admin
 /erase-personal-data.php}}}.

 But then we also need to change the following line in the private
 {{{_wp_privacy_requests_screen_options()}}} function in {{{src/wp-
 admin/includes/privacy-tools.php}}}:

 {{{
 'option' => str_replace( 'tools_page_', '', get_current_screen()->id ) .
 '_requests_per_page',

 }}}

 to preserve the existing options names:
 {{{export_personal_data_requests_per_page}}} and
 {{{remove_personal_data_requests_per_page}}}, if I recall correctly, as
 the screen ID has changed.

 Or deprecate {{{_wp_privacy_requests_screen_options()}}} and add directly:

 {{{
 $args = array(
         'option'  => 'export_personal_data_requests_per_page',
 );

 add_screen_option( 'per_page', $args );

 }}}

 to

 {{{
 src/wp-admin/export-personal-data.php
 }}}

 and

 {{{
 $args = array(
         'option'  => 'remove_personal_data_requests_per_page',
 );

 add_screen_option( 'per_page', $args );

 }}}

 to

 {{{
 src/wp-admin/erase-personal-data.php
 }}}

 to preserve the existing pagination screen options.

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


More information about the wp-trac mailing list