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
3 years ago
Page_Search.php
3 years ago
Page_Singular.php
3 years ago
Page_Term_Archive.php
3 years ago
Referrer.php
2 years ago
View_Stats.php
2 years ago
Visitor.php
3 years ago
WooCommerce_Stats.php
3 years ago
Page_Author_Archive.php
66 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP_SCOPED\IAWP\Models; |
| 4 | |
| 5 | class Page_Author_Archive extends Page |
| 6 | { |
| 7 | private $author_id; |
| 8 | public function __construct($row) |
| 9 | { |
| 10 | $this->author_id = $row->author_id; |
| 11 | parent::__construct($row); |
| 12 | } |
| 13 | protected function resource_key() : string |
| 14 | { |
| 15 | return 'author_id'; |
| 16 | } |
| 17 | protected function resource_value() : string |
| 18 | { |
| 19 | return $this->author_id; |
| 20 | } |
| 21 | protected function calculate_is_deleted() : bool |
| 22 | { |
| 23 | return \get_userdata($this->author_id) == \false; |
| 24 | } |
| 25 | protected function calculate_url() |
| 26 | { |
| 27 | return \get_author_posts_url($this->author_id); |
| 28 | } |
| 29 | protected function calculate_title() |
| 30 | { |
| 31 | return \get_the_author_meta('display_name', $this->author_id) . ' ' . \esc_html__('Archive', 'independent-analytics'); |
| 32 | } |
| 33 | protected function calculate_type() |
| 34 | { |
| 35 | return 'author-archive'; |
| 36 | } |
| 37 | protected function calculate_type_label() |
| 38 | { |
| 39 | return \esc_html__('Author Archive', 'independent-analytics'); |
| 40 | } |
| 41 | protected function calculate_icon() |
| 42 | { |
| 43 | return '<span class="dashicons dashicons-admin-users"></span>'; |
| 44 | } |
| 45 | protected function calculate_author_id() |
| 46 | { |
| 47 | return $this->author_id; |
| 48 | } |
| 49 | protected function calculate_author() |
| 50 | { |
| 51 | return \get_the_author_meta('display_name', $this->author_id); |
| 52 | } |
| 53 | protected function calculate_avatar() |
| 54 | { |
| 55 | return \get_avatar($this->author_id, 20); |
| 56 | } |
| 57 | protected function calculate_date() |
| 58 | { |
| 59 | return null; |
| 60 | } |
| 61 | protected function calculate_category() |
| 62 | { |
| 63 | return []; |
| 64 | } |
| 65 | } |
| 66 |