1 | <?php |
||
18 | */ |
||
19 | class BD_Users_Page extends BD_Page { |
||
20 | /** |
||
21 | * Make this class a "hybrid Singleton". |
||
22 | * |
||
23 | * @static |
||
24 | * |
||
25 | * @since 5.5 |
||
26 | */ |
||
27 | public static function factory() { |
||
28 | static $instance = false; |
||
29 | |||
30 | if ( ! $instance ) { |
||
31 | $instance = new self; |
||
32 | } |
||
33 | |||
34 | return $instance; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Initialize and setup variables. |
||
39 | * |
||
40 | * @since 5.5 |
||
41 | */ |
||
42 | protected function initialize() { |
||
43 | $this->page_slug = 'bulk-delete-users'; |
||
44 | $this->item_type = 'users'; |
||
45 | $this->capability = 'delete_users'; |
||
46 | |||
47 | $this->label = array( |
||
48 | 'page_title' => __( 'Bulk Delete Users', 'bulk-delete' ), |
||
49 | 'menu_title' => __( 'Bulk Delete Users', 'bulk-delete' ), |
||
50 | ); |
||
51 | |||
52 | $this->messages = array( |
||
53 | 'warning_message' => __( 'WARNING: Users deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ), |
||
54 | ); |
||
55 | |||
56 | add_filter( 'plugin_action_links', array( $this, 'add_plugin_action_links' ), 10, 2 ); |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Adds setting links in plugin listing page. |
||
61 | * Based on http://striderweb.com/nerdaphernalia/2008/06/wp-use-action-links/. |
||
62 | * |
||
63 | * @param array $links List of current links |
||
64 | * @param string $file Plugin filename |
||
65 | * |
||
66 | * @return array $links Modified list of links |
||
67 | */ |
||
68 | public function add_plugin_action_links( $links, $file ) { |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * Add Help tabs. |
||
81 | * |
||
82 | * @since 5.5 |
||
83 | * |
||
84 | * @param mixed $help_tabs |
||
85 | */ |
||
86 | protected function add_help_tab( $help_tabs ) { |
||
87 | $overview_tab = array( |
||
88 | 'title' => __( 'Overview', 'bulk-delete' ), |
||
89 | 'id' => 'overview_tab', |
||
90 | 'content' => '<p>' . __( 'This screen contains different modules that allows you to delete users or schedule them for deletion.', 'bulk-delete' ) . '</p>', |
||
91 | 'callback' => false, |
||
92 | ); |
||
93 | $help_tabs['overview_tab'] = $overview_tab; |
||
100 |