Requests_Hooks::register()publicWP 1.0

Register a callback for a hook

{} Это метод класса: Requests_Hooks{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$Requests_Hooks = new Requests_Hooks();
$Requests_Hooks->register( $hook, $callback, $priority );
$hook(строка) (обязательный)
Hook name
$callback(callback) (обязательный)
Function/method to call on event
$priority(int)
Priority number. <0 is executed earlier, >0 is executed later

Код Requests_Hooks::register() WP 6.1.1

public function register($hook, $callback, $priority = 0) {
	if (!isset($this->hooks[$hook])) {
		$this->hooks[$hook] = array();
	}
	if (!isset($this->hooks[$hook][$priority])) {
		$this->hooks[$hook][$priority] = array();
	}

	$this->hooks[$hook][$priority][] = $callback;
}