Opened 6 years ago
Last modified 4 years ago
#44034 assigned enhancement
Privacy: Introduce a function to count user requests by type
Reported by: | birgire | Owned by: | garrett-eclipse |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Privacy | Keywords: | has-patch needs-unit-tests needs-refresh |
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)
Change History (7)
#4
@
6 years ago
- Keywords gdpr removed
Removing the GDPR keyword. This has been replaced by the new Privacy component and privacy focuses in Trac.
#6
@
4 years ago
- Keywords needs-refresh added; 2nd-opinion removed
- Milestone changed from Awaiting Review to Future Release
- Owner set to garrett-eclipse
- Status changed from new to assigned
Thanks @birgire sorry for the delayed review, this seems like it would make a great enhancement. It's a bit late for 5.6 so let's mark for Future Release.
I have two questions;
- Why return an object and not an associative array?
- This is a mostly duplicate of the existing function, could we merge the code and just expose it in both locations?
Note: once the milestone is finalized we'll at minimum need to refresh the @since.
44034.diff is a an example that takes
WP_Privacy_Requests_Table::get_request_counts( $type )
into a reusablewp_count_user_requests( $type )
function that's filterable with thewp_count_user_requests
filter.