page.php
4 years ago
page_author_archive.php
4 years ago
page_date_archive.php
4 years ago
page_home.php
4 years ago
page_not_found.php
4 years ago
page_post_type_archive.php
4 years ago
page_search.php
4 years ago
page_singular.php
4 years ago
page_term_archive.php
4 years ago
referrer.php
4 years ago
page_search.php
75 lines
| 1 | <?php |
| 2 | |
| 3 | if (!class_exists('IAWP_Page_Search')) { |
| 4 | class IAWP_Page_Search extends IAWP_Page |
| 5 | { |
| 6 | private $search_query; |
| 7 | |
| 8 | public function __construct($row) |
| 9 | { |
| 10 | $this->search_query = $row->search_query; |
| 11 | parent::__construct($row); |
| 12 | } |
| 13 | |
| 14 | protected function resource_key(): string |
| 15 | { |
| 16 | return 'search_query'; |
| 17 | } |
| 18 | |
| 19 | protected function resource_value(): string |
| 20 | { |
| 21 | return $this->search_query; |
| 22 | } |
| 23 | |
| 24 | protected function calculate_is_deleted(): bool |
| 25 | { |
| 26 | return false; |
| 27 | } |
| 28 | |
| 29 | public function calculate_url() |
| 30 | { |
| 31 | return get_search_link($this->search_query); |
| 32 | } |
| 33 | |
| 34 | protected function calculate_title() |
| 35 | { |
| 36 | return esc_html__('Search:', 'iawp') . ' "' . $this->search_query . '"'; |
| 37 | } |
| 38 | |
| 39 | protected function calculate_type() |
| 40 | { |
| 41 | return 'search-archive'; |
| 42 | } |
| 43 | |
| 44 | protected function calculate_type_label() |
| 45 | { |
| 46 | return esc_html__('Search', 'iawp'); |
| 47 | } |
| 48 | |
| 49 | protected function calculate_icon() |
| 50 | { |
| 51 | return '<span class="dashicons dashicons-search"></span>'; |
| 52 | } |
| 53 | |
| 54 | protected function calculate_author_id() |
| 55 | { |
| 56 | return null; |
| 57 | } |
| 58 | |
| 59 | protected function calculate_author() |
| 60 | { |
| 61 | return null; |
| 62 | } |
| 63 | |
| 64 | protected function calculate_avatar() |
| 65 | { |
| 66 | return null; |
| 67 | } |
| 68 | |
| 69 | protected function calculate_date() |
| 70 | { |
| 71 | return null; |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 |