WordPress at Your Fingertips
function is not described

Requests_Hooks::register() public WP 1.0

Register a callback for a hook

{} It's a method of the class: Requests_Hooks{}

No Hooks.


null. Nothing.


$Requests_Hooks = new Requests_Hooks();
$Requests_Hooks->register( $hook, $callback, $priority );
$hook(string) (required)
Hook name
$callback(callback) (required)
Function/method to call on event
Priority number. <0 is executed earlier, >0 is executed later

Code of Requests_Hooks::register() WP 5.8

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;