Yoast\WP\SEO\Presentations

Indexable_Author_Archive_Presentation::generate_canonical()publicYoast 1.0

Generates the canonical.

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

Хуков нет.

Возвращает

Строку. The canonical.

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

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

Код Indexable_Author_Archive_Presentation::generate_canonical() Yoast 19.7.1

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

	if ( ! $this->permalink ) {
		return '';
	}

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

	return $this->permalink;
}