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
SearchHandler.php
35 lines
| 1 | <?php namespace NestedPages\Form\Handlers; |
| 2 | |
| 3 | class SearchHandler extends BaseHandler { |
| 4 | |
| 5 | /** |
| 6 | * URL to redirect to |
| 7 | * @var string |
| 8 | */ |
| 9 | private $url; |
| 10 | |
| 11 | |
| 12 | public function __construct() |
| 13 | { |
| 14 | parent::__construct(); |
| 15 | $this->setURL(); |
| 16 | $this->redirect(); |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Set the URL |
| 21 | */ |
| 22 | private function setURL() |
| 23 | { |
| 24 | $this->url = sanitize_text_field($_POST['page']) . '&search=' . sanitize_text_field($_POST['search_term']); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Redirect to new URL |
| 29 | */ |
| 30 | private function redirect() |
| 31 | { |
| 32 | header('Location:' . $this->url); |
| 33 | } |
| 34 | |
| 35 | } |