Requests_Hooks::dispatch

Advertisement

Summery Summery

Dispatch a message

Syntax Syntax

Requests_Hooks::dispatch( string $hook, array $parameters = array() )

Parameters Parameters

$hook

(string) (Required) Hook name

$parameters

(array) (Optional) Parameters to pass to callbacks

Default value: array()

Return Return

(boolean) Successfulness

Source Source

File: wp-includes/Requests/Hooks.php

	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;
	}

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.