W3cubDocs

/WordPress

WP_Scripts::are_all_dependents_in_footer( string $handle ): bool

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

Description

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

Parameters

$handlestringrequired
Script handle.

Return

bool Whether all dependents are in the footer.

Source

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;
}

Changelog

Version Description
6.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_scripts/are_all_dependents_in_footer