WordPress.org

Make WordPress Core

Opened 8 weeks ago

Last modified 7 hours ago

#43910 new enhancement

Add actions and filters so plugins can easily extend export/erasure functionality

Reported by: xkon Owned by:
Milestone: 4.9.8 Priority: normal
Severity: normal Version: 4.9.6
Component: Privacy Keywords: gdpr has-patch needs-testing
Focuses: Cc:

Description

Splitting this from #43481 .

We're waiting for some feedback first to add more thoughts into this, but it needs it's own ticket at the moment.

Attachments (1)

43910.diff (8.1 KB) - added by allendav 2 weeks ago.

Download all attachments as: .zip

Change History (12)

#1 @desrosj
5 weeks ago

  • Component changed from General to Privacy

Moving to the new Privacy component.

#2 @desrosj
5 weeks ago

  • Version set to 4.9.6

Marking Privacy change as introduced in 4.9.6.

#3 @allendav
5 weeks ago

Let's add actions:

  • in wp-admin/includes/user.php on _wp_personal_data_export_page after the page heading, after the request form, and after the requests table
  • in wp-admin/includes/user.php on _wp_personal_data_removal_page after the page heading, after the request form, and after the requests table
  • in wp-admin/privacy.php after the page heading, after the intro paragraphs, before our first table tow, after our last table row, and after the table itself
  • in wp-admin/tools.php (for ?wp-privacy-policy-guide ) before AND after the div containing WP_Privacy_Policy_Content::privacy_policy_guide,

Let's add filters:

  • in wp-admin/privacy.php for the "As a website owner" through "information for you to consider adding to your policy." intro paragraphs

#4 @allendav
5 weeks ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #gdpr-compliance by allendav. View the logs.


5 weeks ago

#6 @desrosj
5 weeks ago

  • Milestone changed from Awaiting Review to 4.9.8

#7 @birgire
5 weeks ago

We have these filters on the query arguments for the corresponding list tables:

  • ms_sites_list_table_query_args
  • comments_list_table_query_args
  • users_list_table_query_args

that are useful if one adds a custom drilldown on the list tables.

So here are more filters to consider:

  • export_personal_data_list_table_query_args
  • remove_personal_data_list_table_query_args

for the WP_Query arguments in WP_Privacy_Requests_Table::prepare_items().

Example:

/**
 * Filters the arguments for the requests query in the Privacy Requests list table.
 *
 * @since 4.9.8
 *
 * @param array $args An array of WP_Query arguments.
 */
$args = apply_filters( $this->request_type . '_list_table_query_args', $args );

$requests_query = new WP_Query( $args );
Last edited 5 weeks ago by birgire (previous) (diff)

This ticket was mentioned in Slack in #gdpr-compliance by allendav. View the logs.


4 weeks ago

@allendav
2 weeks ago

#9 @allendav
2 weeks ago

  • Keywords has-patch needs-testing added; needs-patch removed

@birgire - thank you! i added your snippet to my patch above

@desrosj @xkon feedback welcome - although they are filterable now, I took extra care to NOT change the introduction strings on the settings page so re-translation shouldn't be required

#10 @desrosj
5 days ago

Related: #44382, #44379.

#11 @desrosj
7 hours ago

Adding this here so I don't forget. Actions could be added to _wp_privacy_completed_request() for before and after data requests being marked completed.

Note: See TracTickets for help on using tickets.