WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Yoast\WP\SEO\Presentations

Indexable_Static_Posts_Page_Presentation::generate_canonical() public Yoast 1.0

Generates the canonical.

{} Это метод класса: Indexable_Static_Posts_Page_Presentation{}

Хуков нет.

Возвращает

Строку. The canonical.

Использование

$Indexable_Static_Posts_Page_Presentation = new Indexable_Static_Posts_Page_Presentation();
$Indexable_Static_Posts_Page_Presentation->generate_canonical();

Код Indexable_Static_Posts_Page_Presentation::generate_canonical() Yoast 15.6.2

<?php
public function generate_canonical() {
	if ( $this->model->canonical ) {
		return $this->model->canonical;
	}

	$current_page = $this->pagination->get_current_archive_page_number();
	$permalink    = $this->get_permalink();

	if ( $current_page > 1 ) {
		return $this->pagination->get_paginated_url( $permalink, $current_page );
	}

	return $permalink;
}