Title: WP_Hook::offsetUnset
Published: December 6, 2016
Last modified: August 20, 2026

---

# WP_Hook::offsetUnset( int $offset )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_hook/offsetunset/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_hook/offsetunset/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_hook/offsetunset/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_hook/offsetunset/?output_format=md#wp--skip-link--target)

Unsets a specified offset.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_hook/offsetunset/?output_format=md#parameters)󠁿

 `$offset`intrequired

The offset to unset.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_hook/offsetunset/?output_format=md#source)󠁿

    ```php
    #[ReturnTypeWillChange]
    public function offsetUnset( $offset ) {
    	unset( $this->callbacks[ $offset ] );
    	$this->priorities = array_keys( $this->callbacks );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-hook.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-hook.php#L543)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-hook.php#L543-L547)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_hook/offsetunset/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.7.0](https://developer.wordpress.org/reference/since/4.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_hook%2Foffsetunset%2F)
before being able to contribute a note or feedback.