/** * @param Plugin $plugin * @param $tag * @param $callback * @param int $priority * @param int $acceptedArgs */ public function __construct(Plugin $plugin, $tag, $callback, $priority = 10, $acceptedArgs = 0) { if (strpos($tag, 'wp_ajax') !== 0) { $tag = 'wp_ajax_' . $tag; } parent::__construct($plugin, $tag, $callback, $priority, $acceptedArgs); }
/** * @param string|int $hookId * @param AbsHook $hook * * @return AbsHook * @throws Exception * @author Panagiotis Vagenas <*****@*****.**> * @since 0.0.2 */ protected function addToPool($hookId, AbsHook $hook) { if (!(is_int($hookId) || is_string($hookId))) { throw new Exception("Key: {$hookId} is not a valid array key"); } if (!isset(static::$pool[$hook->getTag()])) { static::$pool[$hook->getTag()] = array(); } if (!isset(static::$pool[$hook->getTag()][$hook->getPriority()])) { static::$pool[$hook->getTag()][$hook->getPriority()] = array(); } return static::$pool[$hook->getTag()][$hook->getPriority()][$hookId] = $hook; }