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 / UndoRegexAutoPromoteHandler.php

UndoRegexAutoPromoteHandler.php in 404 Solution trunk, at includes/admin/actions/UndoRegexAutoPromoteHandler.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 'undoRegexAutoPromote': reverts the last regex auto-promotion
9 * (manual redirect that was silently converted to a regex match) back to a
10 * manual redirect with the original URL. Surfaced as a one-click undo on the
11 * admin notice that announces the auto-promotion.
12 */
13 class ABJ_404_Solution_UndoRegexAutoPromoteHandler implements ABJ_404_Solution_AdminActionHandlerInterface {
14
15 /** @var ABJ_404_Solution_PluginLogicAdminActions */
16 private $parent;
17
18 public function __construct(ABJ_404_Solution_PluginLogicAdminActions $parent) {
19 $this->parent = $parent;
20 }
21
22 public function nonceAction(): string {
23 return 'abj404undoRegexAutoPromote';
24 }
25
26 public function nonceArg(): string {
27 return '_wpnonce';
28 }
29
30 public function useCheckAdminReferer(): bool {
31 return true;
32 }
33
34 public function handle(string $action, string &$sub): string {
35 return $this->parent->handleActionUndoRegexAutoPromote();
36 }
37 }
38