Make WordPress Core


Ignore:
Timestamp:
06/08/2021 01:54:27 AM (5 years ago)
Author:
noisysocks
Message:

Make new WordPress installations use blocks in widget areas instead of widgets

Modifies wp_install_defaults() so that when you install a new WordPress site you
have block in your widget areas, not widgets.

Fixes #53324.
Props isabel_brison, hellofromtonya, andraganescu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/widgets.php

    r50996 r51088  
    2727                add_theme_support( 'customize-selective-refresh-widgets' );
    2828                add_action( 'widgets_init', array( $this, 'remove_widgets_block_editor' ) );
     29
    2930                $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) );
    3031                wp_set_current_user( $user_id );
     32
     33                update_option(
     34                        'widget_search',
     35                        array(
     36                                2              => array( 'title' => '' ),
     37                                '_multiwidget' => 1,
     38                        )
     39                );
     40                update_option(
     41                        'widget_categories',
     42                        array(
     43                                2              => array(
     44                                        'title'        => '',
     45                                        'count'        => 0,
     46                                        'hierarchical' => 0,
     47                                        'dropdown'     => 0,
     48                                ),
     49                                '_multiwidget' => 1,
     50                        )
     51                );
     52                update_option(
     53                        'sidebars_widgets',
     54                        array(
     55                                'wp_inactive_widgets' => array(),
     56                                'sidebar-1'           => array( 'search-2' ),
     57                                'sidebar-2'           => array( 'categories-2' ),
     58                                'array_version'       => 3,
     59                        )
     60                );
     61
    3162                $GLOBALS['wp_customize'] = new WP_Customize_Manager();
    3263                $this->manager           = $GLOBALS['wp_customize'];
Note: See TracChangeset for help on using the changeset viewer.