PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.1.4
Independent Analytics – WordPress Analytics Plugin v2.1.4
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / IAWP / Models / Page_Author_Archive.php
Page_Author_Archive.php
66 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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