WP_Hook::has_filters(): bool

In this article

Checks if any callbacks have been registered for this hook.

Return

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

Source

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

	return false;
}

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

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