Yoast\WP\SEO\Llms_Txt\Infrastructure\Content
Manual_Post_Collection::get_content_type_entry_wp_query
Gets the content entries with WP query.
Метод класса: Manual_Post_Collection{}
Хуков нет.
Возвращает
Content_Type_Entry. The content type entry.
Использование
$Manual_Post_Collection = new Manual_Post_Collection(); $Manual_Post_Collection->get_content_type_entry_wp_query( $page_id ): ?Content_Type_Entry;
- $page_id(int) (обязательный)
- The id of the page.
Код Manual_Post_Collection::get_content_type_entry_wp_query() Manual Post Collection::get content type entry wp query Yoast 27.8
public function get_content_type_entry_wp_query( int $page_id ): ?Content_Type_Entry {
$page = \get_post( $page_id );
if ( $page !== null && $page->post_password === '' && $page->post_status === 'publish' ) {
return Content_Type_Entry::from_post( $page, \get_permalink( $page->ID ) );
}
return null;
}