/** * @param $filter * @param $callback * @param int $priority */ public static function unregister($filter, $callback, $priority = 100) { if (!isset(self::$FilterSections[$filter]['handler'])) { if (!isset(self::$FilterSections)) { self::$FilterSections = []; } $id = generate_hash_for_array($callback); unset(self::$FilterSections[$filter][$priority][$id]); return; } }
/** * Register a section. * * @param $section * @param $callback * @param int $priority */ public static function register($section, $callback, $priority = 100) { if (!isset(self::$ViewSections[$section]['handler'])) { if (!isset(self::$ViewSections)) { self::$ViewSections = array(); } $id = generate_hash_for_array($callback); self::$ViewSections[$section][$priority][$id] = $callback; return; } $handler = self::$ViewSections[$section]['handler']; call_user_func($handler, $section, $callback); }
/** * @param $hook * @param $callback * @param int $priority */ public static function removeCallback($hook, $callback, $priority = 100) { $id = generate_hash_for_array($callback); unset(self::$Hooks[$hook][$priority][$id]); }