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

In this article

Removes all callbacks from the current filter.

Parameters

$priorityint|falseoptional
The priority number to remove.

Default:false

Source

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

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

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

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.