_wp_block_theme_register_classic_sidebars()
Registers the previous theme's sidebars for the block themes.
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
_wp_block_theme_register_classic_sidebars();
Заметки
- Global. Массив. $wp_registered_sidebars The registered sidebars.
Список изменений
| С версии 6.2.0 | Введена. |
Код _wp_block_theme_register_classic_sidebars() wp block theme register classic sidebars WP 6.9
function _wp_block_theme_register_classic_sidebars() {
global $wp_registered_sidebars;
if ( ! wp_is_block_theme() ) {
return;
}
$classic_sidebars = get_theme_mod( 'wp_classic_sidebars' );
if ( empty( $classic_sidebars ) ) {
return;
}
// Don't use `register_sidebar` since it will enable the `widgets` support for a theme.
foreach ( $classic_sidebars as $sidebar ) {
$wp_registered_sidebars[ $sidebar['id'] ] = $sidebar;
}
}