BaseHandler.php
11 years ago
EmptyTrashHandler.php
11 years ago
GetTaxonomiesHandler.php
11 years ago
ListingSortHandler.php
11 years ago
NestToggleHandler.php
11 years ago
NewChildHandler.php
11 years ago
NewLinkHandler.php
11 years ago
QuickEditHandler.php
11 years ago
QuickEditLinkHandler.php
11 years ago
SearchHandler.php
11 years ago
SortHandler.php
11 years ago
SyncMenuHandler.php
11 years ago
EmptyTrashHandler.php
22 lines
| 1 | <?php namespace NestedPages\Form\Handlers; |
| 2 | |
| 3 | class EmptyTrashHandler extends BaseHandler { |
| 4 | |
| 5 | public function __construct() |
| 6 | { |
| 7 | parent::__construct(); |
| 8 | $this->emptyTrash(); |
| 9 | } |
| 10 | |
| 11 | private function emptyTrash() |
| 12 | { |
| 13 | if ( $this->post_repo->emptyTrash($_POST['posttype']) ){ |
| 14 | return wp_send_json(array( |
| 15 | 'status'=>'success', |
| 16 | 'message'=> __('Trash successfully emptied.') |
| 17 | )); |
| 18 | } |
| 19 | $this->sendErrorResponse(); |
| 20 | } |
| 21 | |
| 22 | } |