_wp_footer_scripts()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
_wp_footer_scripts()
Описание
В классических темах, когда стили блоков загружаются по требованию через wp_load_classic_theme_block_styles_on_demand(), эта функция заменяется замыканием в wp_hoist_late_printed_styles(), которое перехватывает вывод двух наборов «поздних» стилей для их подъёма в HEAD с помощью выходного буфера улучшения шаблонов:
Стили, относящиеся к блокам, вставляются сразу после таблицы стилей wp-block-library.
Все остальные стили добавляются в конец HEAD.
Замыкание вызывает print_footer_scripts() для вывода скриптов в подвале как обычно.
Оригинал (английский)
In classic themes, when block styles are loaded on demand via wp_load_classic_theme_block_styles_on_demand() , this function is replaced by a closure in wp_hoist_late_printed_styles() which will capture the printing of two sets of “late” styles to be hoisted to the HEAD by means of the template enhancement output buffer:
- Styles related to blocks are inserted right after the wp-block-library stylesheet.
- All other styles are appended to the end of the HEAD.
The closure calls print_footer_scripts() to print scripts in the footer as usual.
Исходный код
wp-includes/script-loader.php:2296
function _wp_footer_scripts() {
print_late_styles();
print_footer_scripts();
}
История изменений
| Версия | Описание |
|---|---|
| 3.3.0 | Introduced. |

