WP_Hook::remove_all_filters

Advertisement

Summery Summery

Removes all callbacks from the current filter.

Syntax Syntax

WP_Hook::remove_all_filters( int|bool $priority = false )

Parameters Parameters

$priority

(Optional) The priority number to remove.

Default value: false

Source Source

File: wp-includes/class-wp-hook.php

	public function remove_all_filters( $priority = false ) {
		if ( ! $this->callbacks ) {
			return;
		}

		if ( false === $priority ) {
			$this->callbacks = array();
		} elseif ( isset( $this->callbacks[ $priority ] ) ) {
			unset( $this->callbacks[ $priority ] );
		}

		if ( $this->nesting_level > 0 ) {
			$this->resort_active_iterations();
		}
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Advertisement

Leave a Reply