WP_Hook::has_filters()publicWP 4.7.0

Checks if any callbacks have been registered for this hook.

Method of the class: WP_Hook{}

No Hooks.

Return

true|false. True if callbacks have been registered for the current hook, otherwise false.

Usage

$WP_Hook = new WP_Hook();
$WP_Hook->has_filters();

Changelog

Since 4.7.0 Introduced.

WP_Hook::has_filters() code WP 6.4.3

public function has_filters() {
	foreach ( $this->callbacks as $callbacks ) {
		if ( $callbacks ) {
			return true;
		}
	}

	return false;
}