WP_Script_Modules::set_in_footer
Sets whether a script module should be printed in the footer.
This is only relevant in block themes.
Method of the class: WP_Script_Modules{}
No Hooks.
Returns
true|false. Whether setting the printing location was successful.
Usage
$WP_Script_Modules = new WP_Script_Modules(); $WP_Script_Modules->set_in_footer( $id, $in_footer ): bool;
- $id(string) (required)
- Script module identifier.
- $in_footer(true|false) (required)
- Whether to print in the footer.
Changelog
| Since 6.9.0 | Introduced. |
WP_Script_Modules::set_in_footer() WP Script Modules::set in footer code WP 7.0.2
public function set_in_footer( string $id, bool $in_footer ): bool {
if ( ! isset( $this->registered[ $id ] ) ) {
return false;
}
$this->registered[ $id ]['in_footer'] = $in_footer;
return true;
}