PluginProbe
Gutenberg / 16.2.0
Gutenberg v16.2.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
gutenberg / lib / compat / wordpress-6.2 / widgets.php

widgets.php in Gutenberg 16.2.0, at lib/compat/wordpress-6.2/widgets.php

36 lines 861 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Core Widget APIs for WP 6.2.
4 *
5 * @package gutenberg
6 */
7
8 if ( ! function_exists( '_wp_block_theme_register_classic_sidebars' ) ) {
9 /**
10 * Registers the previous theme's sidebars for the block themes.
11 *
12 * @since 6.2.0
13 * @access private
14 *
15 * @global array $wp_registered_sidebars Registered sidebars.
16 */
17 function _wp_block_theme_register_classic_sidebars() {
18 global $wp_registered_sidebars;
19
20 if ( ! wp_is_block_theme() ) {
21 return;
22 }
23
24 $legacy_sidebars = get_theme_mod( 'wp_classic_sidebars' );
25 if ( empty( $legacy_sidebars ) ) {
26 return;
27 }
28
29 // Don't use `register_sidebar` since it will enable the `widgets` support for a theme.
30 foreach ( $legacy_sidebars as $sidebar ) {
31 $wp_registered_sidebars[ $sidebar['id'] ] = $sidebar;
32 }
33 }
34 add_action( 'widgets_init', '_wp_block_theme_register_classic_sidebars' );
35 }
36