$tag, 'component' => $component, 'callback' => $function_to_add, 'priority' => $priority, 'accepted_args' => $accepted_args ); return $hooks; } /** * Register the filters and actions with WordPress. */ public static function run() { if (!empty(self::$filters)) { foreach (self::$filters as $hook) { add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); } } if (!empty(self::$actions)) { foreach (self::$actions as $hook) { add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); } } } }