WordPress at Your Fingertips
function is not described

WP_Hook::remove_filter() public WP 4.7.0

Removes a callback function from a filter hook.

{} It's a method of the class: WP_Hook{}

No Hooks.

Return

true|false. Whether the callback existed before it was removed.

Usage

$WP_Hook = new WP_Hook();
$WP_Hook->remove_filter( $hook_name, $callback, $priority );
$hook_name(string) (required)
The filter hook to which the function to be removed is hooked.
$callback(callable) (required)
The callback to be removed from running when the filter is applied.
$priority(int) (required)
The exact priority used when adding the original filter callback.

Changelog

Since 4.7.0 Introduced.

Code of WP_Hook::remove_filter() WP 5.8

<?php
public function remove_filter( $hook_name, $callback, $priority ) {
	$function_key = _wp_filter_build_unique_id( $hook_name, $callback, $priority );

	$exists = isset( $this->callbacks[ $priority ][ $function_key ] );

	if ( $exists ) {
		unset( $this->callbacks[ $priority ][ $function_key ] );

		if ( ! $this->callbacks[ $priority ] ) {
			unset( $this->callbacks[ $priority ] );

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

	return $exists;
}