Yoast\WP\SEO\Llms_Txt\Infrastructure\Content

Manual_Post_Collection::get_content_type_entry_for_indexable │ public │ Yoast 1.0

Gets the content entries with indexables.

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

Хуков нет.

Возвращает

Content_Type_Entry. The content type entry.

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

$Manual_Post_Collection = new Manual_Post_Collection();
$Manual_Post_Collection->get_content_type_entry_for_indexable( $page_id ): ?Content_Type_Entry;
$page_id(int) (обязательный)
The id of the page.

Код Manual_Post_Collection::get_content_type_entry_for_indexable() Yoast 28.6

public function get_content_type_entry_for_indexable( int $page_id ): ?Content_Type_Entry {
	$indexable = $this->indexable_repository->find_by_id_and_type( $page_id, 'post' );
	if ( $indexable && ( $indexable->is_public === null || $indexable->is_public ) ) {
		$indexable_meta = $this->meta->for_indexable( $indexable );
		if ( $indexable_meta->post instanceof WP_Post ) {
			return Content_Type_Entry::from_meta( $indexable_meta );
		}
	}

	return null;
}