Yoast\WP\SEO\Task_List\Infrastructure\Tasks_Collectors
Tasks_Collector::__construct
Constructs the collector.
Метод класса: Tasks_Collector{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Tasks_Collector = new Tasks_Collector(); $Tasks_Collector->__construct( Task_Interface ...$tasks );
- Task_Interface ...$tasks(обязательный)
- .
Код Tasks_Collector::__construct() Tasks Collector:: construct Yoast 28.3
public function __construct( Task_Interface ...$tasks ) {
$tasks_with_id = [];
foreach ( $tasks as $task ) {
if ( $task instanceof Child_Task_Interface ) {
// Implementations of the Child_Task_Interface are excluded at the DI level, but let's make sure to also throw an exception.
throw new Incorrect_Child_Task_Usage_Exception( \esc_html( $task->get_id() ) );
}
if ( $task instanceof Post_Type_Task_Interface ) {
continue;
}
$tasks_with_id[ $task->get_id() ] = $task;
}
$this->tasks = $tasks_with_id;
}