Falcon_Connector::add_notify_action PHP Метод

add_notify_action() защищенный Метод

Basically add_action but specifically for actions to send notifications on. Automatically registers cron tasks if running in asynchronous mode.
protected add_notify_action ( string $hook, callback $callback, integer $priority = 10, integer $accepted_args )
$hook string Name of the action to register for.
$callback callback Callback to register.
$priority integer Priority to register at, larger numbers = later run.
$accepted_args integer Number of arguments to pass through, default 0.
    protected function add_notify_action($hook, $callback, $priority = 10, $accepted_args = 0)
    {
        if (Falcon::should_send_async()) {
            add_action($hook, array($this, 'schedule_async_action'), $priority, $accepted_args);
            add_action('falcon_async-' . $hook, $callback, 10, $accepted_args);
        } else {
            add_action($hook, $callback, $priority, $accepted_args);
        }
    }