1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace BulkWP\BulkDelete\Core\Users; |
4
|
|
|
|
5
|
|
|
use BulkWP\BulkDelete\Core\Base\BaseDeletePage; |
6
|
|
|
|
7
|
|
|
defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Bulk Delete Users Page. |
11
|
|
|
* |
12
|
|
|
* Shows the list of modules that provides the ability to delete users. |
13
|
|
|
* |
14
|
|
|
* @since 5.5 |
15
|
|
|
* @since 6.0.0 Renamed to DeleteUsersPage |
16
|
|
|
*/ |
17
|
|
|
class DeleteUsersPage extends BaseDeletePage { |
18
|
|
|
/** |
19
|
|
|
* Initialize and setup variables. |
20
|
|
|
* |
21
|
|
|
* @since 5.5 |
22
|
|
|
*/ |
23
|
|
|
protected function initialize() { |
24
|
|
|
if ( is_multisite() ) { |
25
|
|
|
$this->multisite_init(); |
26
|
|
|
} else { |
27
|
|
|
$this->single_site_init(); |
28
|
|
|
} |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
protected function multisite_init() { |
32
|
|
|
$this->page_slug = 'bulk-remove-users'; |
33
|
|
|
$this->item_type = 'users'; |
34
|
|
|
|
35
|
|
|
$this->label = array( |
36
|
|
|
'page_title' => __( 'Bulk Remove Users', 'bulk-delete' ), |
37
|
|
|
'menu_title' => __( 'Bulk Remove Users', 'bulk-delete' ), |
38
|
|
|
); |
39
|
|
|
|
40
|
|
|
$this->messages = array( |
41
|
|
|
'warning_message' => __( 'WARNING: Users will be only removed from the subsite. If the users should be deleted, then link them to the page at network level.', 'bulk-delete' ), |
42
|
|
|
); |
43
|
|
|
|
44
|
|
|
$this->show_link_in_plugin_list = true; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
protected function single_site_init() { |
48
|
|
|
$this->page_slug = 'bulk-delete-users'; |
49
|
|
|
$this->item_type = 'users'; |
50
|
|
|
|
51
|
|
|
$this->label = array( |
52
|
|
|
'page_title' => __( 'Bulk Delete Users', 'bulk-delete' ), |
53
|
|
|
'menu_title' => __( 'Bulk Delete Users', 'bulk-delete' ), |
54
|
|
|
); |
55
|
|
|
|
56
|
|
|
$this->messages = array( |
57
|
|
|
'warning_message' => __( 'WARNING: Users deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ), |
58
|
|
|
); |
59
|
|
|
|
60
|
|
|
$this->show_link_in_plugin_list = true; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Add Help tabs. |
65
|
|
|
* |
66
|
|
|
* @since 5.5 |
67
|
|
|
* |
68
|
|
|
* @param array $help_tabs List of help tabs. |
69
|
|
|
* |
70
|
|
|
* @return array Modified list of help tabs. |
71
|
|
|
*/ |
72
|
|
|
protected function add_help_tab( $help_tabs ) { |
73
|
|
|
$overview_tab = array( |
74
|
|
|
'title' => __( 'Overview', 'bulk-delete' ), |
75
|
|
|
'id' => 'overview_tab', |
76
|
|
|
'content' => '<p>' . __( 'This screen contains different modules that allows you to delete users or schedule them for deletion.', 'bulk-delete' ) . '</p>', |
77
|
|
|
'callback' => false, |
78
|
|
|
); |
79
|
|
|
|
80
|
|
|
$help_tabs['overview_tab'] = $overview_tab; |
81
|
|
|
|
82
|
|
|
return $help_tabs; |
83
|
|
|
} |
84
|
|
|
} |
85
|
|
|
|