Yoast\WP\SEO\Presentations

Indexable_Post_Type_Presentation::generate_rel_next()publicYoast 1.0

Generates the rel next.

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

Хуков нет.

Возвращает

Строку. The rel prev next.

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

$Indexable_Post_Type_Presentation = new Indexable_Post_Type_Presentation();
$Indexable_Post_Type_Presentation->generate_rel_next();

Код Indexable_Post_Type_Presentation::generate_rel_next() Yoast 22.4

public function generate_rel_next() {
	if ( $this->model->number_of_pages === null ) {
		return '';
	}

	if ( $this->pagination->is_rel_adjacent_disabled() ) {
		return '';
	}

	$current_page = \max( 1, $this->pagination->get_current_post_page_number() );
	if ( $this->model->number_of_pages <= $current_page ) {
		return '';
	}

	return $this->get_paginated_url( $this->model->permalink, ( $current_page + 1 ) );
}