Campaign.php
3 years ago
Current_Traffic.php
3 years ago
Device.php
2 years ago
Geo.php
2 years ago
Page.php
2 years ago
Page_Author_Archive.php
3 years ago
Page_Date_Archive.php
3 years ago
Page_Home.php
3 years ago
Page_Not_Found.php
3 years ago
Page_Post_Type_Archive.php
2 years ago
Page_Search.php
3 years ago
Page_Singular.php
2 years ago
Page_Term_Archive.php
3 years ago
Referrer.php
2 years ago
View_Stats.php
2 years ago
Visitor.php
2 years ago
WooCommerce_Stats.php
3 years ago
Page_Home.php
78 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP_SCOPED\IAWP\Models; |
| 4 | |
| 5 | class Page_Home extends Page |
| 6 | { |
| 7 | public function __construct($row) |
| 8 | { |
| 9 | parent::__construct($row); |
| 10 | } |
| 11 | protected function resource_key() |
| 12 | { |
| 13 | return 'resource'; |
| 14 | } |
| 15 | protected function resource_value() |
| 16 | { |
| 17 | return 'home'; |
| 18 | } |
| 19 | protected function calculate_is_deleted() : bool |
| 20 | { |
| 21 | return \false; |
| 22 | } |
| 23 | protected function calculate_url() |
| 24 | { |
| 25 | $id = \get_option('page_for_posts'); |
| 26 | if ($id == 0) { |
| 27 | return \get_home_url(); |
| 28 | } else { |
| 29 | return \get_permalink($id); |
| 30 | } |
| 31 | } |
| 32 | protected function calculate_title() |
| 33 | { |
| 34 | $id = \get_option('page_for_posts'); |
| 35 | if ($id == 0) { |
| 36 | return \esc_html__('Blog', 'independent-analytics'); |
| 37 | } else { |
| 38 | return \get_the_title($id); |
| 39 | } |
| 40 | } |
| 41 | protected function calculate_type() |
| 42 | { |
| 43 | return 'blog-archive'; |
| 44 | } |
| 45 | protected function calculate_type_label() |
| 46 | { |
| 47 | return \esc_html__('Blog', 'independent-analytics'); |
| 48 | } |
| 49 | protected function calculate_icon() |
| 50 | { |
| 51 | if (\get_option('page_on_front') == 0) { |
| 52 | return '<span class="dashicons dashicons-admin-home"></span>'; |
| 53 | } else { |
| 54 | return '<span class="dashicons dashicons-edit-large"></span>'; |
| 55 | } |
| 56 | } |
| 57 | protected function calculate_author_id() |
| 58 | { |
| 59 | return null; |
| 60 | } |
| 61 | protected function calculate_author() |
| 62 | { |
| 63 | return null; |
| 64 | } |
| 65 | protected function calculate_avatar() |
| 66 | { |
| 67 | return null; |
| 68 | } |
| 69 | protected function calculate_date() |
| 70 | { |
| 71 | return null; |
| 72 | } |
| 73 | protected function calculate_category() |
| 74 | { |
| 75 | return []; |
| 76 | } |
| 77 | } |
| 78 |