Prida formular do nastaveni
@param HookFactory $hook
353082
public function addHook(HookFactory $hook): void
	{
		$hook->init();
		$this->hooks[$hook->name] = $hook;
	}
1262756
public final static function action( $hook, $action, $priority = null, $accepted_args = null ) {
		$priority      = $priority ?? self::PRIORITY;
		$accepted_args = $accepted_args ?? self::ACCEPTED_ARGS;
		add_action( $hook, $action, (int) $priority, (int) $accepted_args );
	}
198267
protected function add_action( $hook, $method, $priority = 10, $arg_count = 1 ) {
		return $this->add_filter( $hook, $method, $priority, $arg_count );
	}
1076803
public function with($hook)
    {
        if (!in_array($hook, PluginInterface::VALID_HOOKS)) {
            throw new InvalidArgumentException("The `{$hook}` hook is not a known plugin hook.");
        }
        foreach ($this as $plugin) {
            if ($plugin->isEnabled($hook)) {
                yield $plugin;
            }
        }
    }
474849
public function enqueue_admin_styles( $hook ) {
		foreach ( $this->styles as $style ) {
			if ( in_array( $style['type'], array( 'admin', 'shared' ) ) ) {
				$this->enqueue_style( $style, $hook );
			}
		}
	}
1230630
public function hooks()
    {
        $this->hook->action(
            'init',
            [$this->taxonomy, 'register']
        )->dispatch();

        $this->hook->action(
            "{$this->taxonomy->getModel()->getSlug()}_add_form_fields",
            [$this->taxonomy, 'fill']
        )->dispatch();

        $this->hook->action(
            "{$this->taxonomy->getModel()->getSlug()}_edit_form_fields",
            [$this->taxonomy, 'fill']
        )->dispatch();

        $this->hook->action(
            "created_{$this->taxonomy->getModel()->getSlug()}",
            [$this->taxonomy, 'save']
        )->dispatch();

        $this->hook->action(
            "edited_{$this->taxonomy->getModel()->getSlug()}",
            [$this->taxonomy, 'save']
        )->dispatch();
    }
420822
public function show(string $hook, array $params = [])
    {
        $path = $this->buildHooksPath($hook);

        return $this->get($path, $params);
    }
1309854
public function exec_hook($hook, $args = array())
    {
        if (!is_array($args)) {
            $args = array('arg' => $args);
        }

        // TODO: avoid recursion by checking in_array($hook, $this->exec_stack) ?

        $args += array('abort' => false);
        array_push($this->exec_stack, $hook);

        // Use for loop here, so handlers added in the hook will be executed too
        if (!empty($this->handlers[$hook])) {
            for ($i = 0; $i < count($this->handlers[$hook]); $i++) {
                $ret = call_user_func($this->handlers[$hook][$i], $args);
                if ($ret && is_array($ret)) {
                    $args = $ret + $args;
                }

                if ($args['break']) {
                    break;
                }
            }
        }

        array_pop($this->exec_stack);
        return $args;
    }
200090
public function addHook(Hook $hook)
  {
    # Attempt to find it first
    $exists = $this->getHook($hook->getName());

    # If it exists, return with null
    if (!\is_null($exists)) {
      return false;
    }

    # Add it to the list
    $this->hooks[$hook];

    return $this;
  }
7412
public static function hook($hook, $params = [])
    {
        $hookRun = isset(self::$mountInfo[$hook]) ? self::$mountInfo[$hook] : null;
        if (!is_null($hookRun)) {
            foreach ($hookRun as $key => $val) {
                if (is_int($key)) {
                    $callBack = $val;
                } else {
                    $plugin = new $key();
                    $callBack = [$plugin, $val];
                }
                $return = call_user_func_array($callBack, array_slice(func_get_args(), 1));

                if (!is_null($return)) {
                    return $return;
                }
            }
        }
        return null;
    }
1076160
private function getHookParams($hook)
    {
        return isset($this->hooks[$hook]) && isset($this->hooks[$hook]['params'])
            ? $this->hooks[$hook]['params']
            : [];
    }
782973
public function addHook($hookwhere, $hook)
    {
        if (is_array($hook)) {
            if (isset($hook['classref']) && isset($hook['method']) && isset($hook['params'])) {
                if (is_object($hook['classref']) && method_exists($hook['classref'], $hook['method'])) {
                    $this->aCustomHooks[$hookwhere][] = $hook;
                    return true;
                }
            }
        }
        return false;
    }
503041
public function addFilter(string $hook, callable $callable, ...$args)
    {
        return add_filter($this->App->Config->©brand['©var'].'_'.$hook, $callable, ...$args);
    }
1116105
public function admin_enqueue_scripts( $hook ) {

		if ( ! in_array( $hook, array( 'post.php', 'post-new.php' ) ) ) {

			return;

		}

		$rtl    = is_rtl() ? '-rtl' : '';
		$suffix = SCRIPT_DEBUG ? '' : '.min';

		wp_enqueue_script(
			'rock-layouts',
			get_template_directory_uri() . "/assets/js/admin/layouts{$suffix}.js",
			array( 'jquery' ),
			ROCK_VERSION
		);

		wp_enqueue_style(
			'rock-layouts',
			get_template_directory_uri() . "/assets/css/admin/layouts{$rtl}{$suffix}.css",
			array(),
			ROCK_VERSION
		);

	}
769246
public function addAction(string $hook, ComponentInterface $component, string $handler, int $priority = 10, int $argCount = 1): void {
		$this->actions[] = new Hook($hook, $component, $handler, $priority, $argCount);
	}
920800
public static function getHookCommand(string $hook) : string
    {
        if (!self::isValid($hook)) {
            throw new RuntimeException(sprintf('Hook \'%s\' is not supported', $hook));
        }
        return Hooks::getValidHooks()[$hook];
    }
22831
protected function add( $hooks, $hook, $service, $method, $priority, $accepted_args ) {
		$hooks[] = array(
			'hook'     => $hook,
			'service'  => $service,
			'method'   => $method,
			'priority' => $priority,
			'args'     => $accepted_args,
		);

		return $hooks;
	}