WP_Hook::offsetSet
Sets a value at a specified offset.
Method of the class: WP_Hook{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_Hook = new WP_Hook(); $WP_Hook->offsetSet( $offset, $value );
- $offset(mixed) (required)
- The offset to assign the value to.
- $value(mixed) (required)
- The value to set.
Changelog
| Since 4.7.0 | Introduced. |
WP_Hook::offsetSet() WP Hook::offsetSet code WP 7.0
public function offsetSet( $offset, $value ) {
if ( is_null( $offset ) ) {
$this->callbacks[] = $value;
} else {
$this->callbacks[ $offset ] = $value;
}
$this->priorities = array_keys( $this->callbacks );
}