-
Notifications
You must be signed in to change notification settings - Fork 2
/
uninstall.php
31 lines (26 loc) · 965 Bytes
/
uninstall.php
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
<?php
/**
* Plugin uninstall file.
*
* @package MembersPrivacyCaps
* @author Justin Tadlock <[email protected]>
* @copyright Copyright (c) 2018, Justin Tadlock
* @link https://themehybrid.com/plugins/members-privacy-caps
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
# Bail if we're not actually uninstalling.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
wp_die( sprintf(
// Translators: %s is the file name wrapped in a code tag.
__( '%s should only be called when uninstalling the plugin.', 'members-privacy-caps' ),
'<code>' . __FILE__ . '</code>'
) );
}
# Remove capabilities added by the plugin.
$role = get_role( 'administrator' );
# If the administrator role exists, remove added capabilities for the plugin.
if ( ! is_null( $role ) ) {
$role->remove_cap( 'export_others_personal_data' );
$role->remove_cap( 'erase_others_personal_data' );
$role->remove_cap( 'manage_privacy_options' );
}