Title: _wp_block_theme_register_classic_sidebars
Published: March 29, 2023
Last modified: August 20, 2026

---

# _wp_block_theme_register_classic_sidebars()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/_wp_block_theme_register_classic_sidebars/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_wp_block_theme_register_classic_sidebars/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_wp_block_theme_register_classic_sidebars/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_wp_block_theme_register_classic_sidebars/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Registers the previous theme’s sidebars for the block themes.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_wp_block_theme_register_classic_sidebars/?output_format=md#source)󠁿

    ```php
    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;
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/widgets.php#L2154)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/widgets.php#L2154-L2170)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_wp_block_theme_register_classic_sidebars/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_is_block_theme()](https://developer.wordpress.org/reference/functions/wp_is_block_theme/)`wp-includes/theme.php` |

Returns whether the active theme is a block-based theme or not.

  | 
| [get_theme_mod()](https://developer.wordpress.org/reference/functions/get_theme_mod/)`wp-includes/theme.php` |

Retrieves theme modification value for the active theme.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_wp_block_theme_register_classic_sidebars/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.2.0](https://developer.wordpress.org/reference/since/6.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_wp_block_theme_register_classic_sidebars%2F)
before being able to contribute a note or feedback.