_wp_block_theme_register_classic_sidebars

The timeline below displays how wordpress function _wp_block_theme_register_classic_sidebars has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Registers the previous theme's sidebars for the block themes.
 *
 * @since 6.2.0
 * @access private
 *
 * @global array $wp_registered_sidebars The registered sidebars.
 */
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;
    }
}

WordPress Version: 6.2

/**
 * Registers the previous theme's sidebars for the block themes.
 *
 * @since 6.2.0
 * @access private
 *
 * @global array $wp_registered_sidebars Registered sidebars.
 */
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;
    }
}