On this page
Requests_Hooks::register( string $hook, callback $callback, int $priority )
Register a callback for a hook
Parameters
$hookstring Required-
Hook name
$callbackcallback Required-
Function/method to call on event
$priorityint Required-
Priority number. <0 is executed earlier, >0 is executed later
Source
File: wp-includes/Requests/Hooks.php. View all references
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;
}
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_hooks/register