|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Bulk Delete Posts by Custom Fields. |
|
4
|
|
|
* |
|
5
|
|
|
* @since 5.5 |
|
6
|
|
|
* |
|
7
|
|
|
* @author Sudar |
|
8
|
|
|
* |
|
9
|
|
|
* @package BulkDelete\Posts\Modules |
|
10
|
|
|
*/ |
|
11
|
|
|
defined( 'ABSPATH' ) || exit; // Exit if accessed directly |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Bulk Delete Posts by Custom Field. |
|
15
|
|
|
* |
|
16
|
|
|
* @since 5.7.0 |
|
17
|
|
|
*/ |
|
18
|
|
|
class Bulk_Delete_Posts_By_Custom_Field extends BD_Post_Meta_Box_Module { |
|
19
|
|
|
|
|
20
|
|
|
protected function initialize() { |
|
21
|
|
|
$this->item_type = 'posts'; |
|
22
|
|
|
$this->field_slug = 'p_custom_field'; |
|
23
|
|
|
$this->meta_box_slug = 'bd_posts_by_custom_field'; |
|
24
|
|
|
$this->meta_box_hook = "bd_add_meta_box_for_{$this->item_type}"; |
|
25
|
|
|
$this->delete_action = 'delete_posts_by_custom_field'; |
|
26
|
|
|
$this->cron_hook = 'do-bulk-delete-posts-by-custom-field'; |
|
27
|
|
|
// TODO: Change the URL. |
|
28
|
|
|
$this->scheduler_url = 'http://bulkwp.com/addons/scheduler-for-deleting-users-by-meta/?utm_source=wpadmin&utm_campaign=BulkDelete&utm_medium=buynow&utm_content=bd-u-ma'; |
|
29
|
|
|
$this->messages = array( |
|
30
|
|
|
'box_label' => __( 'By User Meta', 'bulk-delete' ), |
|
31
|
|
|
'scheduled' => __( 'Users from with the selected user meta are scheduled for deletion.', 'bulk-delete' ), |
|
32
|
|
|
'deleted_single' => __( 'Deleted %d user with the selected user meta', 'bulk-delete' ), |
|
33
|
|
|
'deleted_plural' => __( 'Deleted %d users with the selected user meta', 'bulk-delete' ), |
|
34
|
|
|
); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function render() { |
|
38
|
|
|
// TODO: Implement render() method. |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function process() { |
|
42
|
|
|
// TODO: Implement process() method. |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public function delete( $delete_options ) { |
|
46
|
|
|
// TODO: Implement delete() method. |
|
47
|
|
|
} |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
new Bulk_Delete_Posts_By_Custom_Field(); |