WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

YoastSEO_Vendor\GuzzleHttp\Promise

task() Yoast 1.0

Adds a function to run in the task queue when it is next run() and returns a promise that is fulfilled or rejected with the result.

Хуков нет.

Возвращает

PromiseInterface.

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

task( $task );
$task(callable) (обязательный)
Task function to run.

Код task() Yoast 15.6.2

<?php
function task(callable $task)
{
    $queue = queue();
    $promise = new \YoastSEO_Vendor\GuzzleHttp\Promise\Promise([$queue, 'run']);
    $queue->add(function () use($task, $promise) {
        try {
            $promise->resolve($task());
        } catch (\Throwable $e) {
            $promise->reject($e);
        } catch (\Exception $e) {
            $promise->reject($e);
        }
    });
    return $promise;
}