Yoast\WP\SEO\Llms_Txt\Infrastructure\Markdown_Services

Content_Types_Collector::make_sure_pages_are_first │ private │ Yoast 1.0

Returns an array of indexable post types with pages and posts as the first two.

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

Хуков нет.

Возвращает

array<WP_Post_Type>. List of indexable post type objects.

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

// private - только в коде основоного (родительского) класса
$result = $this->make_sure_pages_are_first( $post_types ): array;
$post_types(array) (обязательный)
List of indexable post type objects.

Код Content_Types_Collector::make_sure_pages_are_first() Yoast 28.8

private function make_sure_pages_are_first( array $post_types ): array {
	$types_to_go_first = [];
	if ( isset( $post_types['page'] ) ) {
		$types_to_go_first['page'] = $post_types['page'];
		unset( $post_types['page'] );
	}
	return \array_merge( $types_to_go_first, $post_types );
}