WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 3 months ago

#44034 new enhancement

Privacy: Introduce a function to count user requests by type

Reported by: birgire Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Privacy Keywords: 2nd-opinion, has-patch, needs-unit-tests
Focuses: administration Cc:

Description

The user request list tables use WP_Privacy_Requests_Table::get_request_counts( $type ) to count user requests by type.

If export- and erase bubble counts will be added in #44000 and if e.g. plugins or core will add request stats to the dashboard ( e.g. "At a glance" or "Activity" metaboxes), then it makes sense to introduce a function like:

wp_count_user_requests( $type )

where type is either 'remove_personal_data' and 'export_personal_data'.

An alternative would be if wp_count_post( $post_type = 'user_request' ) would support $post_name as well, for the request types.

Attachments (1)

44034.diff (2.0 KB) - added by birgire 12 months ago.

Download all attachments as: .zip

Change History (6)

@birgire
12 months ago

#1 @birgire
12 months ago

  • Keywords has-patch added

44034.diff is a an example that takes WP_Privacy_Requests_Table::get_request_counts( $type ) into a reusable wp_count_user_requests( $type ) function that's filterable with the wp_count_user_requests filter.

#2 @desrosj
11 months ago

  • Component changed from General to Privacy

Moving to the new Privacy component.

#3 @desrosj
11 months ago

  • Keywords needs-unit-tests added

#4 @desrosj
10 months ago

  • Keywords gdpr removed

Removing the GDPR keyword. This has been replaced by the new Privacy component and privacy focuses in Trac.

#5 @pento
3 months ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.