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.

Method of the class: WP_Scripts{}

No Hooks.

Return

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

Usage

// private - for code of main (parent) class only
$result = $this->are_all_dependents_in_footer( $handle );
$handle(string) (required)
Script handle.

Changelog

Since 6.4.0 Introduced.

WP_Scripts::are_all_dependents_in_footer() code WP 6.6.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;
}