Yoast\WP\SEO\Llms_Txt\Infrastructure\Content
Automatic_Post_Collection::get_recently_modified_posts_indexables
Returns most recently modified posts of a post type, using indexables.
Метод класса: Automatic_Post_Collection{}
Хуков нет.
Возвращает
Массив
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_recently_modified_posts_indexables( $post_type, $limit, $exclude_older_than_one_year, $search_filter ): array;
- $post_type(строка) (обязательный)
- The post type.
- $limit(int) (обязательный)
- The maximum number of posts to return.
- $exclude_older_than_one_year(true|false) (обязательный)
- Whether to exclude posts older than one year.
- $search_filter(строка)
- The search filter to apply to the query.
По умолчанию:''
Код Automatic_Post_Collection::get_recently_modified_posts_indexables() Automatic Post Collection::get recently modified posts indexables Yoast 27.7
private function get_recently_modified_posts_indexables( string $post_type, int $limit, bool $exclude_older_than_one_year, string $search_filter = '' ): array {
$posts = [];
$recently_modified_indexables = $this->indexable_repository->get_recently_modified_posts( $post_type, $limit, $exclude_older_than_one_year, $search_filter );
foreach ( $recently_modified_indexables as $indexable ) {
$indexable_meta = $this->meta->for_indexable( $indexable );
if ( $indexable_meta->post instanceof WP_Post ) {
$posts[] = Content_Type_Entry::from_meta( $indexable_meta );
}
}
return $posts;
}