WP_Hook::has_filters()publicWP 4.7.0

Checks if any callbacks have been registered for this hook.

Метод класса: WP_Hook{}

Хуков нет.

Возвращает

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

Использование

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

Список изменений

С версии 4.7.0 Введена.

Код WP_Hook::has_filters() WP 6.1.1

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

	return false;
}