WP_Scripts::are_all_dependents_in_footer
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.
Returns
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() WP Scripts::are all dependents in footer code WP 7.0
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;
}