WordPress at a glance
function is not described

WP_Hook::has_filter() public WP 4.7.0

Checks if a specific action has been registered for this hook.

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

No Hooks.

Return

true/false/Int. The priority of that hook is returned, or false if the function is not attached.

Usage

$WP_Hook = new WP_Hook();
$WP_Hook->has_filter( $tag, $function_to_check );
$tag(string)
The name of the filter hook.
Default: ''
$function_to_check(callable/true/false)
The callback to check for.
Default: false

Changelog

Since 4.7.0 Introduced.

Code of WP_Hook::has_filter() WP 5.5.1

<?php
public function has_filter( $tag = '', $function_to_check = false ) {
	if ( false === $function_to_check ) {
		return $this->has_filters();
	}

	$function_key = _wp_filter_build_unique_id( $tag, $function_to_check, false );
	if ( ! $function_key ) {
		return false;
	}

	foreach ( $this->callbacks as $priority => $callbacks ) {
		if ( isset( $callbacks[ $function_key ] ) ) {
			return $priority;
		}
	}

	return false;
}