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_home.php
88 lines
| 1 | <?php |
| 2 | |
| 3 | if (!class_exists('IAWP_Page_Home')) { |
| 4 | class IAWP_Page_Home extends IAWP_Page |
| 5 | { |
| 6 | public function __construct($row) |
| 7 | { |
| 8 | parent::__construct($row); |
| 9 | } |
| 10 | |
| 11 | protected function resource_key() |
| 12 | { |
| 13 | return null; |
| 14 | } |
| 15 | |
| 16 | protected function resource_value() |
| 17 | { |
| 18 | return null; |
| 19 | } |
| 20 | |
| 21 | protected function calculate_is_deleted(): bool |
| 22 | { |
| 23 | return false; |
| 24 | } |
| 25 | |
| 26 | protected function calculate_url() |
| 27 | { |
| 28 | $id = get_option('page_for_posts'); |
| 29 | |
| 30 | if ($id == 0) { |
| 31 | return get_home_url(); |
| 32 | } else { |
| 33 | return get_permalink($id); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | protected function calculate_title() |
| 38 | { |
| 39 | $id = get_option('page_for_posts'); |
| 40 | |
| 41 | if ($id == 0) { |
| 42 | return esc_html__('Blog', 'iawp'); |
| 43 | } else { |
| 44 | return get_the_title($id); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | protected function calculate_type() |
| 49 | { |
| 50 | return 'blog-archive'; |
| 51 | } |
| 52 | |
| 53 | protected function calculate_type_label() |
| 54 | { |
| 55 | return esc_html__('Blog', 'iawp'); |
| 56 | } |
| 57 | |
| 58 | protected function calculate_icon() |
| 59 | { |
| 60 | if (get_option('page_on_front') == 0) { |
| 61 | return '<span class="dashicons dashicons-admin-home"></span>'; |
| 62 | } else { |
| 63 | return '<span class="dashicons dashicons-edit-large"></span>'; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | protected function calculate_author_id() |
| 68 | { |
| 69 | return null; |
| 70 | } |
| 71 | |
| 72 | protected function calculate_author() |
| 73 | { |
| 74 | return null; |
| 75 | } |
| 76 | |
| 77 | protected function calculate_avatar() |
| 78 | { |
| 79 | return null; |
| 80 | } |
| 81 | |
| 82 | protected function calculate_date() |
| 83 | { |
| 84 | return null; |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 |