hospitalPluginScripts
@param string $hook hook to the page
502315
public function hospitalPluginScripts($hook)
    {
        $jQ = array(
            'jquery'
        );
        if (in_array($hook, $this->pages)) {
            foreach ($this->scripts as $script) {
                self::hospitalRegisterScript($script, $jQ, $hook);
            }
        }
    }
761405
public function addHook(Hook $hook)
    {
        if (isset($this->hooks[$hook->name]) === false) {
            $this->logger->debug(
                "Adding definition for hook '{$hook->name}' for the first time."
            );
            $this->hooks[$hook->name] = [];
        }

        $this->hooks[$hook->name][] = $hook->definition;
    }
1141701
public function format( $hook ): array {

		$callbacks = [];

		if ( $hook instanceof \WP_Hook ) {
			$hook = $hook->callbacks;
		}

		if ( empty( $hook ) ) {
			return $callbacks;
		}

		ksort( $hook );

		$functions = array_merge( ...$hook );

		foreach ( $functions as $function ) {
			$callback = $this->get_callback_name( $function['function'], $function['accepted_args'] );

			if ( false !== strpos( $callback, 'Hook_Collector' ) ) {
				continue;
			}

			$callbacks[] = $callback;
		}

		return $callbacks;
	}
353082
public function addHook(HookFactory $hook): void
	{
		$hook->init();
		$this->hooks[$hook->name] = $hook;
	}
471920
public function loadConfigsByHook($hook, $reload = false)
    {
        // Load configs from DB
        $data = $this->app->db->conn()->prepare(
            'SELECT * FROM ' . $this->app->db->getPrefix() . 'config
                         WHERE `config_loadhook` = ?');
        $data->execute(array($hook));
        $data = $data->fetchAll(\PDO::FETCH_ASSOC);
        foreach ($data as $config) {
            // Load corresponding class and get config array
            if ($reload || !$this->configExists($config['config_name'])) {
                $this->config[$config['config_name']] = $this->createConfigObject($config['config_name'], $config['config_data'], true);
            }
        }
    }
693813
public function setHook(string $hook) : Installer
    {
        if (!empty($hook) && !Util::isValid($hook)) {
            throw new Exception\InvalidHookName('Invalid hook name \'' . $hook . '\'');
        }
        $this->hookToHandle = $hook;
        return $this;
    }
339433
public function hospitalLocalizeScript($file, $data)
    {
        $json_dates = json_encode($data);
        $params = array(
            'my_arr' => $json_dates
        );
        wp_localize_script('hospital_admin_script' . $file, 'php_params', $params);
    }
21746
public function registerConfiguredHooks(string $config = '')
    {
        if (empty($config)) {
            $config = 'app.hooks';
        }

        $hooks = Collection::make($this->config[$config]);

        (new HooksRepository($this))->load($hooks->all());
    }
400662
protected function makeTemponaryBackup(Hook $hook)
    {
        $folder = $this->createTempFolder();
        $this->filesystem->copyDirectory($hook->getPath(), $folder);

        $this->tempDirectories[$hook->name] = $folder;
    }
18484
protected function getAdminHook( $page_hook ) {
		global $pagenow, $plugin_page;

		$hook_suffix = '';
		if ( ! empty( $page_hook ) ) {
			$hook_suffix = $page_hook;
		} else if ( isset( $plugin_page ) ) {
			$hook_suffix = $plugin_page;
		} else if ( isset( $pagenow ) ) {
			$hook_suffix = $pagenow;
		}

		return $hook_suffix;
	}
679250
public function dispatch($hook, $parameters = array()) {
		if (empty($this->hooks[$hook])) {
			return false;
		}

		foreach ($this->hooks[$hook] as $priority => $hooked) {
			foreach ($hooked as $callback) {
				call_user_func_array($callback, $parameters);
			}
		}

		return true;
	}
1195125
protected function seedHook(Hook $hook)
    {
        $folders = (array) $hook->getComposerHookKey('seeders', []);
        $basePath = $hook->getPath().'/';

        $this->runSeeders($folders, $basePath);
    }
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];
    }
1165736
protected function enqueue_script( $script, $hook = null ) {
		if ( $script['condition']( $hook ) ) {
			wp_enqueue_script(
				$script['handle'],
				$this->url . $script['src'] . $this->min . '.js',
				isset( $script['deps'] ) ? $script['deps'] : array(),
				$this->version,
				isset( $script['footer'] ) ? $script['footer'] : false
			);

			if ( isset( $script['localize'] ) ) {
				if ( is_callable( $script['localize'] ) ) { // @todo make all properties callables
					$script['localize'] = call_user_func( $script['localize'] );
				}

				wp_localize_script(
					$script['handle'],
					$script['localize']['name'],
					$script['localize']['data']
				);
			}
		}
	}
167834
public function addHook(\CampaignChain\CoreBundle\Entity\Hook $hooks)
    {
        $this->hooks[] = $hooks;

        return $this;
    }
718459
public function invokePluginHook($hookName)
	{
		$args = func_get_args();
		array_shift($args);

		foreach($this->plugins as $plugin) {
			if(method_exists($plugin, $hookName) === false)
				continue;

			call_user_func_array(array($plugin, $hookName), $args);
		}
	}
249654
public function invokePluginsHook($hook, $args)
    {
        foreach ($this->getPlugins() as $plugin) {
            if (method_exists($plugin, $hook)) {
                call_user_func_array(array($plugin, $hook), $args);
            }
        }
    }