Automattic\WP\Cron_Control\REST_API::run_event PHP Метод

run_event() публичный Метод

Execute a specific event
public run_event ( $request )
    public function run_event($request)
    {
        // Parse request for details needed to identify the event to execute
        // `$timestamp` is, unsurprisingly, the Unix timestamp the event is scheduled for
        // `$action` is the md5 hash of the action used when the event is registered
        // `$instance` is the md5 hash of the event's arguments array, which Core uses to index the `cron` option
        $event = $request->get_json_params();
        $timestamp = isset($event['timestamp']) ? absint($event['timestamp']) : null;
        $action = isset($event['action']) ? trim(sanitize_text_field($event['action'])) : null;
        $instance = isset($event['instance']) ? trim(sanitize_text_field($event['instance'])) : null;
        return rest_ensure_response(Events::instance()->run_event($timestamp, $action, $instance));
    }