WP_Scripts::are_all_dependents_in_footer()privateWP 6.4.0

Checks whether all dependents of a given handle are in the footer.

If there are no dependents, this is considered the same as if all dependents were in the footer.

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

Хуков нет.

Возвращает

true|false. Whether all dependents are in the footer.

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

// private - только в коде основоного (родительского) класса
$result = $this->are_all_dependents_in_footer( $handle );
$handle(строка) (обязательный)
Script handle.

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

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

Код WP_Scripts::are_all_dependents_in_footer() WP 6.7.2

private function are_all_dependents_in_footer( $handle ) {
	foreach ( $this->get_dependents( $handle ) as $dep ) {
		if ( isset( $this->groups[ $dep ] ) && 0 === $this->groups[ $dep ] ) {
			return false;
		}
	}
	return true;
}