-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuddypress-data-exporters.php
More file actions
93 lines (78 loc) · 4.11 KB
/
buddypress-data-exporters.php
File metadata and controls
93 lines (78 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/*
Plugin name: BuddyPress Data Exporters
Description: GDPR compliance tools for BuddyPress. This plugin lets you use these tools before they're part of a BuddyPress release.
Author: The BuddyPress Team
Version: 0.1
*/
/**
* Load late, so that BuddyPress-native tools take precedence.
*/
add_action( 'bp_init', function() {
require __DIR__ . '/exporters.php';
add_filter( 'wp_privacy_personal_data_exporters', function( $exporters ) {
if ( bp_is_active( 'settings' ) && ! isset( $exporters['buddypress-settings'] ) ) {
$exporters['buddypress-settings'] = array(
'exporter_friendly_name' => __( 'BuddyPress Settings Data', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_settings_personal_data_exporter',
);
}
if ( bp_is_active( 'activity' ) && ! isset( $exporters['buddypress-activity'] ) ) {
$exporters['buddypress-activity'] = array(
'exporter_friendly_name' => __( 'BuddyPress Activity Data', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_activity_personal_data_exporter',
);
}
if ( bp_is_active( 'xprofile' ) && ! isset( $exporters['buddypress-xprofile'] ) ) {
$exporters['buddypress-xprofile'] = array(
'exporter_friendly_name' => __( 'BuddyPress XProfile Data', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_xprofile_personal_data_exporter',
);
}
if ( bp_is_active( 'messages' ) && ! isset( $exporters['buddypress-messages'] ) ) {
$exporters['buddypress-messages'] = array(
'exporter_friendly_name' => __( 'BuddyPress Messages', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_messages_personal_data_exporter',
);
}
if ( bp_is_active( 'groups' ) && ! isset( $exporters['buddypress-groups-memberships'] ) ) {
$exporters['buddypress-groups-memberships'] = array(
'exporter_friendly_name' => __( 'BuddyPress Group Memberships', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_groups_memberships_personal_data_exporter',
);
$exporters['buddypress-groups-pending-requests'] = array(
'exporter_friendly_name' => __( 'BuddyPress Pending Group Membership Requests', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_groups_pending_requests_personal_data_exporter',
);
$exporters['buddypress-groups-pending-received-invitations'] = array(
'exporter_friendly_name' => __( 'BuddyPress Pending Group Invitations (Received)', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_groups_pending_received_invitations_personal_data_exporter',
);
$exporters['buddypress-groups-pending-sent-invitations'] = array(
'exporter_friendly_name' => __( 'BuddyPress Pending Group Invitations (Sent)', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_groups_pending_sent_invitations_personal_data_exporter',
);
}
if ( bp_is_active( 'friends' ) && ! isset( $exporters['buddypress-friends'] ) ) {
$exporters['buddypress-friends'] = array(
'exporter_friendly_name' => __( 'BuddyPress Friends', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_friends_personal_data_exporter',
);
$exporters['buddypress-friends-pending-sent-requests'] = array(
'exporter_friendly_name' => __( 'BuddyPress Friend Requests (Sent)', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_friends_pending_sent_requests_personal_data_exporter',
);
$exporters['buddypress-friends-pending-received-requests'] = array(
'exporter_friendly_name' => __( 'BuddyPress Friend Requests (Received)', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_friends_pending_received_requests_personal_data_exporter',
);
}
if ( bp_is_active( 'notifications' ) && ! isset( $exporters['buddypress-notifications'] ) ) {
$exporters['buddypress-notifications'] = array(
'exporter_friendly_name' => __( 'BuddyPress Notifications Data', 'buddypress' ),
'callback' => '\BuddyPress\DataExporters\bp_notifications_personal_data_exporter',
);
}
return $exporters;
} );
}, 100 );