Для хука admin_notices

@param callable $callback      Функция срабатывающая в момент события
@param int      $priority      Приоритет выполнения функции
@param int      $accepted_args Число аргументов которые принимает функция
762200
public static function adminNotices( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'admin_notices', $callback, $priority, $accepted_args );
	}
303112
public static function init( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'init', $callback, $priority, $accepted_args );
	}
46282
private function finish_callback(
		callable $callback, array $args
	) {
		$this->request_handled = true;
		$this->wrap_callback($callback, $args);
		return $this;
	}
1096841
public function sendNotifications($notification_type, array $args = [])
    {
        if (!isset($this->_notifications[$notification_type])) {
            // No exception thrown and error logged since this method will be called from
            // within the SDK
            return;
        }

        /**
         * Note: Before PHP 7, if the callback in call_user_func is called with less number of arguments than expected,
         * a warning is issued but the method is still executed with assigning null to the remaining
         * arguments. From PHP 7, ArgumentCountError is thrown in such case and the method isn't executed.
         * Therefore, we set error handler for warnings so that we raise an exception and notify the
         * user that the registered callback has more number of arguments than
         * expected. This should be done to keep a consistent behavior across all PHP versions.
         */

        set_error_handler(array($this, 'reportArgumentCountError'), E_WARNING);

        foreach (array_values($this->_notifications[$notification_type]) as $callback) {
            try {
                call_user_func_array($callback, $args);
            } catch (ArgumentCountError $e) {
                $this->reportArgumentCountError();
            } catch (Exception $e) {
                $this->_logger->log(Logger::ERROR, "Problem calling notify callback.");
            }
        }

        restore_error_handler();
    }
1359840
public function hook($name, $callable, $priority = 10)
    {
        if (!isset($this->hooks[$name])) {
            $this->hooks[$name] = array(array());
        }
        if (is_callable($callable)) {
            $this->hooks[$name][(int) $priority][] = $callable;
        }
    }
392039
public function handleRemaining(callable $callback)
    {
        $properties = $this->getRemainingMutations();
        if (!$properties) {
            // Nothing to do, don't register callback
            return;
        }

        foreach ($properties as $propertyName) {
            // HTTP Accepted
            $this->result[$propertyName] = 202;

            $this->propertyUpdateCallbacks[] = [
                $properties,
                $callback,
            ];
        }
    }
403447
public function listen($events, $listener, $priority = 0, $acceptedArgs = 1)
    {
        foreach ((array)$events as $event)
        {
            $this->listeners[$event][$priority][] = $this->makeListener($listener);

            unset($this->sorted[$event]);

            if ( ! isset($this->registeredWpActions[$event]))
            {
                $this->registeredWpActions[$event] = true;

                add_action(
                    $event,
                    function () use ($event)
                    {
                        return $this->fire($event, func_get_args());
                    },
                    $priority,
                    $acceptedArgs
                );
            }
        }
    }
907005
public static function templateInclude( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'template_include', $callback, $priority, $accepted_args );
	}
205691
public function Listen($signal_type, $callback, $priority=10)
    {
        if(!isset($this->listeners[$signal_type]))
            $this->listeners[$signal_type] = array();
        
        $this->listeners[$signal_type][] = array(
            'callback'=>$callback,
            'priority'=>$priority
        );
        
        $this->listeners[$signal_type] = SignalHandler::Sort(
            $this->listeners[$signal_type], 'priority'
        );
    }
1239682
public function finish($callback, $priority = 0)
    {
        //        $app = $this;
        $container = $this->container;
        $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($callback, $container) {
            call_user_func($this->container['callback_resolver']->resolveCallback($callback), $event->getRequest(), $event->getResponse(), $container);
        }, $priority);
    }
900775
public static function parseQuery( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'parse_query', $callback, $priority, $accepted_args );
	}
379471
public function attach(string $event, callable $callback, int $priority = self::PRIORITY_MIN): void
    {

        /* If there aren't any listeners for an event yet */
        if (empty($this->events[$event])) {

            /* Create a new queue for the event. */
            $this->events[$event] = new PriorityQueue();
        }

        /* Create a new listener with the given data */
        $listener = new EventListener($event, $callback, $priority);

        /* Insert the new callback into the queue. */
        $this->events[$event]->insert($listener, $priority);
    }
595960
public static function wpHead( $callback, $priority = null, $accepted_args = null ) {
		self::action( 'wp_head', $callback, $priority, $accepted_args );
	}
60449
public function hook($event, callable $callback, $priority = 10)
    {
        $this->app->hook($event, $callback, $priority);
    }
1028223
public function on(string $eventName, callable $callBack, int $priority = 100)
    {
        if (!isset($this->listeners[$eventName])) {
            $this->listeners[$eventName] = [
                true,  // If there's only one item, it's sorted
                [$priority],
                [$callBack]
            ];
        } else {
            $this->listeners[$eventName][0] = false; // marked as unsorted
            $this->listeners[$eventName][1][] = $priority;
            $this->listeners[$eventName][2][] = $callBack;
        }
    }
336601
public function finish($callback, $priority = 0)
    {
        $app = $this;

        $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($callback, $app) {
            call_user_func($app['callback_resolver']->resolveCallback($callback), $event->getRequest(), $event->getResponse(), $app);
        }, $priority);
    }
849223
public function addFilter( $filter, $callback, $priority = 10 )
    {
        if ( !isset( $this->filters[ $filter ] ) )
        {
            $this->filters[ $filter ] = array();
        }

        $this->filters[ $filter ][] = array(
            'priority' => $priority,
            'callback' => $callback,
        );

        if ( 1 < count( $this->filters[ $filter ] ) )
        {
            usort( $this->filters[ $filter ], array( $this, '_sortByPriority' ) );
        }

        if ( $this->debug )
        {
            echo PHP_EOL . '+FILTER: ' . $filter . ' -> '
                    . $this->_serializeCallback( $callback )
                    . ' + Priority: ' . $priority . PHP_EOL;
        }
    }