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_author_archive.php
75 lines
| 1 | <?php |
| 2 | |
| 3 | if (!class_exists('IAWP_Page_Author_Archive')) { |
| 4 | class IAWP_Page_Author_Archive extends IAWP_Page |
| 5 | { |
| 6 | private $author_id; |
| 7 | |
| 8 | public function __construct($row) |
| 9 | { |
| 10 | $this->author_id = $row->author_id; |
| 11 | parent::__construct($row); |
| 12 | } |
| 13 | |
| 14 | protected function resource_key(): string |
| 15 | { |
| 16 | return 'author_id'; |
| 17 | } |
| 18 | |
| 19 | protected function resource_value(): string |
| 20 | { |
| 21 | return $this->author_id; |
| 22 | } |
| 23 | |
| 24 | protected function calculate_is_deleted(): bool |
| 25 | { |
| 26 | return get_userdata($this->author_id) == false; |
| 27 | } |
| 28 | |
| 29 | protected function calculate_url() |
| 30 | { |
| 31 | return get_author_posts_url($this->author_id); |
| 32 | } |
| 33 | |
| 34 | protected function calculate_title() |
| 35 | { |
| 36 | return get_the_author_meta('display_name', $this->author_id) . ' ' . esc_html__('Archive', 'iawp'); |
| 37 | } |
| 38 | |
| 39 | protected function calculate_type() |
| 40 | { |
| 41 | return 'author-archive'; |
| 42 | } |
| 43 | |
| 44 | protected function calculate_type_label() |
| 45 | { |
| 46 | return esc_html__('Author Archive', 'iawp'); |
| 47 | } |
| 48 | |
| 49 | protected function calculate_icon() |
| 50 | { |
| 51 | return '<span class="dashicons dashicons-admin-users"></span>'; |
| 52 | } |
| 53 | |
| 54 | protected function calculate_author_id() |
| 55 | { |
| 56 | return $this->author_id; |
| 57 | } |
| 58 | |
| 59 | protected function calculate_author() |
| 60 | { |
| 61 | return get_the_author_meta('display_name', $this->author_id); |
| 62 | } |
| 63 | |
| 64 | protected function calculate_avatar() |
| 65 | { |
| 66 | return get_avatar($this->author_id, 20); |
| 67 | } |
| 68 | |
| 69 | protected function calculate_date() |
| 70 | { |
| 71 | return null; |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 |