-
Notifications
You must be signed in to change notification settings - Fork 4
/
uninstall.php
executable file
·44 lines (38 loc) · 1.15 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* Uninstall UsersWP - Recaptcha
*
* Uninstalling UsersWP - Recaptcha deletes the plugin options.
*
*/
// Exit if accessed directly.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
$settings = get_option('uwp_settings', array());
if ( 1 == $settings[ 'uninstall_recaptcha_data' ] ) {
$settings = get_option('uwp_settings', array());
$options = array(
'recaptcha_api_key',
'recaptcha_api_secret',
'recaptcha_version',
'enable_recaptcha_in_register_form',
'enable_recaptcha_in_login_form',
'enable_recaptcha_in_forgot_form',
'enable_recaptcha_in_account_form',
'enable_recaptcha_in_frontend_form',
'enable_recaptcha_in_wp_login_form',
'enable_recaptcha_in_wp_register_form',
'disable_recaptcha_role_for',
'recaptcha_title',
'recaptcha_theme',
'uninstall_recaptcha_data',
);
$options = apply_filters('uwp_recaptcha_uninstall_data', $options);
if ( !empty( $options ) ) {
foreach ( $options as $option ) {
unset( $settings[$option] );
}
}
update_option('uwp_settings', $settings);
}