GC_Hook::remove_all_filters()

最后更新于:2021-11-27 21:32:25

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

Removes all callbacks from the current filter.

参数

$priority

(int|false) (Optional) The priority number to remove.

Default value: false

源文件

文件: gc-includes/class-gc-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();
		}
	}