WP_Script_Modules::set_in_footer
Sets whether a script module should be printed in the footer.
This is only relevant in block themes.
Метод класса: WP_Script_Modules{}
Хуков нет.
Возвращает
bool. Whether setting the printing location was successful.
Использование
$WP_Script_Modules = new WP_Script_Modules(); $WP_Script_Modules->set_in_footer( $id, $in_footer ): bool;
- $id(строка) (обязательный)
- Script module identifier.
- $in_footer(true|false) (обязательный)
- Whether to print in the footer.
Список изменений
| С версии 6.9.0 | Введена. |
Код WP_Script_Modules::set_in_footer() WP Script Modules::set in footer WP 7.1.4
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;
}