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;
		}
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.