PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/presentations/archive-adjacent-trait.php +13 -6 18.7 → trunk View file →
@@ -9,15 +9,20 @@
9 9 * Class Archive_Adjacent.
10 10 *
11 11 * Presentation object for indexables.
12 12 *
13 - * @property Indexable $model The indexable.
14 - * @property Pagination_Helper $pagination The pagination helper. Should be defined in the parent
15 - * class because of trait issues in PHP 5.6.
13 + * @property Indexable $model The indexable.
16 14 */
17 15 trait Archive_Adjacent {
18 16
19 17 /**
18 + * Holds the Pagination_Helper instance.
19 + *
20 + * @var Pagination_Helper
21 + */
22 + protected $pagination;
23 +
24 + /**
20 25 * Sets the helpers for the trait.
21 26 *
22 27 * @required
23 28 *
@@ -23,8 +28,10 @@
23 28 *
24 29 * @codeCoverageIgnore
25 30 *
26 31 * @param Pagination_Helper $pagination The pagination helper.
32 + *
33 + * @return void
27 34 */
28 35 public function set_archive_adjacent_helpers( Pagination_Helper $pagination ) {
29 36 $this->pagination = $pagination;
30 37 }
@@ -45,12 +52,12 @@
45 52 return '';
46 53 }
47 54 // Check if the previous page is the first page.
48 55 if ( $current_page === 2 ) {
49 - return $this->get_permalink();
56 + return $this->permalink;
50 57 }
51 58
52 - return $this->pagination->get_paginated_url( $this->get_permalink(), ( $current_page - 1 ) );
59 + return $this->pagination->get_paginated_url( $this->permalink, ( $current_page - 1 ) );
53 60 }
54 61
55 62 /**
56 63 * Generates the rel next.
@@ -66,7 +73,7 @@
66 73 if ( $this->pagination->get_number_of_archive_pages() <= $current_page ) {
67 74 return '';
68 75 }
69 76
70 - return $this->pagination->get_paginated_url( $this->get_permalink(), ( $current_page + 1 ) );
77 + return $this->pagination->get_paginated_url( $this->permalink, ( $current_page + 1 ) );
71 78 }
72 79 }