1 | <?php |
||
11 | class Bulk_Delete_By_Days { |
||
12 | public $days; |
||
13 | public $op; |
||
14 | |||
15 | /** |
||
16 | * Default constructor. |
||
17 | */ |
||
18 | public function __construct() { |
||
19 | add_action( 'parse_query', array( $this, 'parse_query' ) ); |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Parse the query. |
||
24 | * |
||
25 | * @param array $query |
||
26 | */ |
||
27 | public function parse_query( $query ) { |
||
34 | } |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Modify the where clause. |
||
39 | * |
||
40 | * @param string $where (optional) |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function filter_where( $where = '' ) { |
||
45 | $where .= ' AND post_date ' . $this->op . " '" . date( 'y-m-d', strtotime( '-' . $this->days . ' days' ) ) . "'"; |
||
46 | |||
47 | return $where; |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Remove the `posts_where` filter. |
||
52 | */ |
||
53 | public function remove_where() { |
||
55 | } |
||
56 | } |
||
57 |