Yoast\WP\SEO\Presentations

Indexable_Date_Archive_Presentation::generate_canonical()publicYoast 1.0

Generates the canonical.

Метод класса: Indexable_Date_Archive_Presentation{}

Хуков нет.

Возвращает

Строку. The canonical.

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

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

Код Indexable_Date_Archive_Presentation::generate_canonical() Yoast 24.0

public function generate_canonical() {
	$canonical = $this->current_page->get_date_archive_permalink();

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

	return $canonical;
}