Yoast\WP\SEO\Task_List\Application\Tasks
Improve_Default_Meta_Descriptions::populate_child_tasks
Populates the child tasks by querying content modified in the last two months.
Метод класса: Improve_Default_Meta_Descriptions{}
Хуков нет.
Возвращает
Child_Task_Interface[].
Использование
$Improve_Default_Meta_Descriptions = new Improve_Default_Meta_Descriptions(); $Improve_Default_Meta_Descriptions->populate_child_tasks(): array;
Код Improve_Default_Meta_Descriptions::populate_child_tasks() Improve Default Meta Descriptions::populate child tasks Yoast 27.7
public function populate_child_tasks(): array {
// @TODO: There's a lot of code duplication that can be abstracted in all the parent tasks so far.
$post_type = $this->get_post_type();
if ( empty( $post_type ) ) {
return [];
}
$two_months_ago = $this->get_recency_timestamp();
$recent_content_items = $this->recent_content_indexable_collector->get_recent_content_for_meta_descriptions(
$post_type,
$two_months_ago,
self::DEFAULT_LIMIT,
);
$child_tasks = [];
foreach ( $recent_content_items as $content_item_data ) {
$child_tasks[] = new Improve_Default_Meta_Descriptions_Child(
$this,
$content_item_data,
);
}
return $child_tasks;
}