Add the hooks defined in $filters and $actions.

@since 1.0.0

@param array $hooks The contents of $filters or $actions.
18559
final private function add_hooks($hooks)
    {
        foreach ($hooks as $tag => $filter) {
            if (\is_string($filter)) {
                $this->add_filter($tag, $filter);
            } else {
                foreach ($filter as $priority => $callbacks) {
                    if (\is_string($callbacks)) {
                        $this->add_filter($tag, $callbacks, $priority);
                    } else {
                        $count = \count($callbacks);

                        for ($i = 0; $i < $count; $i++) {
                            $this->add_filter($tag, $callbacks[ $i ], $priority);
                        }
                    }
                }
            }
        }
    }
132557
public function hookFilter($text, $filter, &$filtered)
    {
        if (!isset($filtered) && (!isset($filter['filter_id']) || $filter['filter_id'] === 'xss')) {
            $filtered = $this->filter($text);
        }
    }
360543
public function setFilters($filters = [])
    {
        foreach ($filters as $key => $value) {
            $this->addFilter($key, $value);
        }

        return $this;
    }
712033
private function parseHooks(array $hooks)
    {
        $list = [];

        foreach ($hooks as $func) {
            if (isset($func['name'])) {
                $list[] = NamedJsFunction::createFromArray($func);

                continue;
            }

            $list[] = ErlangFunction::createFromArray($func);
        }

        return $list;
    }
173721
public function setFilters($filters)
    {
        if(is_null($filters)){
            $filters = "";
        }
        if (is_string($filters)) {
            $filters = $this->parseFilters($filters);
        }

        $this->filters = array_merge($this->filters, $filters);
    }
611869
public function hooks(array $parameters = [])
    {
        $data = $this->client->projects()->hooks($this->id, $parameters);

        $hooks = array();
        foreach ($data as $hook) {
            $hooks[] = ProjectHook::fromArray($this->getClient(), $this, $hook);
        }

        return $hooks;
    }
1145124
protected function load_hooks() {
		add_action( 'init', [ $this, 'load' ] );
		add_action( 'init', [ $this, 'background_update' ] );
		add_action( 'init', [ $this, 'set_options_filter' ] );
		add_action( 'wp_ajax_github-updater-update', [ $this, 'ajax_update' ] );
		add_action( 'wp_ajax_nopriv_github-updater-update', [ $this, 'ajax_update' ] );

		// Load hook for shiny updates Basic Authentication headers.
		if ( self::is_doing_ajax() ) {
			$this->load_authentication_hooks();
		}

		add_filter( 'extra_theme_headers', [ $this, 'add_headers' ] );
		add_filter( 'extra_plugin_headers', [ $this, 'add_headers' ] );
		add_filter( 'upgrader_source_selection', [ $this, 'upgrader_source_selection' ], 10, 4 );

		// Needed for updating from update-core.php.
		if ( ! self::is_doing_ajax() ) {
			add_filter( 'upgrader_pre_download', [ $this, 'upgrader_pre_download' ], 10, 3 );
		}
	}
879552
protected function add_plugin( $file )
    {
        $this->plugins[ ] = $file;
        add_filter(static::FILTER_HOOK_ACTION_LINKS . plugin_basename($file), [$this, 'change_action_links']);
    }
198267
protected function add_action( $hook, $method, $priority = 10, $arg_count = 1 ) {
		return $this->add_filter( $hook, $method, $priority, $arg_count );
	}
890834
public function enableLibraryHooks($hooks)
    {
        $hooks = is_array($hooks) ? $hooks : array($hooks);
        $invalidHooks = array_diff($hooks, array_keys($this->availableLibraryHooks));
        if ($invalidHooks) {
            throw new \InvalidArgumentException("Library hooks don't exist: " . join(', ', $invalidHooks));
        }
        $this->enabledLibraryHooks = $hooks;

        return $this;
    }
547531
def apply_hooks(hooks, tuples, *args)
      hooks.reduce(tuples) do |a, e|
        if e.is_a?(Hash)
          hook_meth, hook_args = e.to_a.flatten(1)
          __send__(hook_meth, a, *args, **hook_args)
        else
          __send__(e, a, *args)
        end
      end
    end
435311
public function setAllowFilters(array $filters = []): void
    {
        $this->allowFilters = [];
        foreach ($filters as $column) {
            $this->addAllowFilter($column);
        }
    }
1041358
public function setFilters(array $filters = [])
    {
        foreach ($filters as $filterName => $filterValue) {
            $this->addFilter($filterName, $filterValue);
        }

        return $this;
    }
569021
public function append($filters)
    {
        if ($filters instanceof FilterBuilder) {
            $filters = $filters->getFilter();
        }

        if ($filters instanceof AndFilterBuilder) {
            foreach (clone $filters as $filter) {
                $this->add(clone $filter);
            }

            return $this;
        }

        $this->andEncapsulate(clone $filters);

        return $this;
    }
624816
public function addHook( $triggers, callable $callable, $key = null )
	{
		if ( !is_array( $triggers ) )
			$triggers = [$triggers];

		if ( is_null( $key ) )
		{
			$key = 0;
			while ( array_key_exists( $key, $this->hooks ) )
			{
				$key++;
			}
		}

		$this->hooks[$key] = ['triggers' => $triggers, 'callable' => $callable];
		$this->bakeTriggers();
	}
140039
public static function run($hook, array $params = array())
    {
        // Make sure the hook index exists
        if (!isset(static::$plugins[$hook])) {
            return false;
        }

        // Run the hook
        foreach (static::$plugins[$hook] as $plugin) {
            call_user_func_array($plugin, $params);
        }
    }
611987
public function setListActions(array $actions)
    {
        foreach ($actions as $key => $action) {
            $this->addListAction($key, $action);
        }

        return $this;
    }