WP_Hook::offsetSet() WordPress Method
The WP_Hook::offsetSet() method is used to add a new callback to a WordPress hook. The first parameter is the name of the hook, and the second parameter is the callback function.
WP_Hook::offsetSet( $offset, $value ) #
Contents
Source
File: wp-includes/class-wp-hook.php
public function offsetSet( $offset, $value ) {
if ( is_null( $offset ) ) {
$this->callbacks[] = $value;
} else {
$this->callbacks[ $offset ] = $value;
}
}
Expand full source codeCollapse full source codeView on TracView on GitHub