PluginProbe
404 Solution / trunk
404 Solution vtrunk
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / admin / actions / EmptyRedirectTrashHandler.php

EmptyRedirectTrashHandler.php in 404 Solution trunk, at includes/admin/actions/EmptyRedirectTrashHandler.php

38 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) {
4 exit;
5 }
6
7 /**
8 * Handles action 'emptyRedirectTrash': permanently deletes all trashed rows
9 * from the redirects table (status in $abj404_redirect_types) via
10 * PluginLogicAdminActions::doEmptyTrash(), then invalidates the view cache.
11 */
12 class ABJ_404_Solution_EmptyRedirectTrashHandler implements ABJ_404_Solution_AdminActionHandlerInterface {
13
14 /** @var ABJ_404_Solution_PluginLogicAdminActions */
15 private $parent;
16
17 public function __construct(ABJ_404_Solution_PluginLogicAdminActions $parent) {
18 $this->parent = $parent;
19 }
20
21 public function nonceAction(): string {
22 return 'abj404_bulkProcess';
23 }
24
25 public function nonceArg(): string {
26 return '_wpnonce';
27 }
28
29 public function useCheckAdminReferer(): bool {
30 return true;
31 }
32
33 public function handle(string $action, string &$sub): string {
34 $this->parent->doEmptyTrash('abj404_redirects');
35 return __('All trashed URLs have been deleted!', '404-solution');
36 }
37 }
38