PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.5
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
wordpress-seo / src / presentations / indexable-home-page-presentation.php

indexable-home-page-presentation.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.5, at src/presentations/indexable-home-page-presentation.php

62 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Presentations;
4
5 /**
6 * Class Indexable_Home_Page_Presentation.
7 *
8 * Presentation object for indexables.
9 */
10 class Indexable_Home_Page_Presentation extends Indexable_Presentation {
11
12 use Archive_Adjacent;
13
14 /**
15 * Generates the canonical.
16 *
17 * @return string The canonical.
18 */
19 public function generate_canonical() {
20 if ( $this->model->canonical ) {
21 return $this->model->canonical;
22 }
23
24 if ( ! $this->permalink ) {
25 return '';
26 }
27
28 $current_page = $this->pagination->get_current_archive_page_number();
29 if ( $current_page > 1 ) {
30 return $this->pagination->get_paginated_url( $this->permalink, $current_page );
31 }
32
33 return $this->permalink;
34 }
35
36 /**
37 * Generates the meta description.
38 *
39 * @return string The meta description.
40 */
41 public function generate_meta_description() {
42 if ( $this->model->description ) {
43 return $this->model->description;
44 }
45
46 return $this->options->get( 'metadesc-home-wpseo' );
47 }
48
49 /**
50 * Generates the title.
51 *
52 * @return string The title.
53 */
54 public function generate_title() {
55 if ( $this->model->title ) {
56 return $this->model->title;
57 }
58
59 return $this->options->get_title_default( 'title-home-wpseo' );
60 }
61 }
62