[wp-trac] [WordPress Trac] #57531: Store legacy sidebars when switching to a block theme

WordPress Trac noreply at wordpress.org
Fri Feb 3 00:14:09 UTC 2023


#57531: Store legacy sidebars when switching to a block theme
-------------------------------------------------+-------------------------
 Reporter:  Mamaduka                             |       Owner:
                                                 |  hellofromTonya
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.2
Component:  Widgets                              |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch gutenberg-merge has-       |     Focuses:
  testing-info has-unit-tests commit             |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55200" 55200]:
 {{{
 #!CommitTicketReference repository="" revision="55200"
 Widgets: Preserve classic sidebars when switching to a block theme.

 When switching to a block theme, classic sidebars were orphaned and their
 widgets remapping to the `'wp_inactive_widgets'` sidebar . This changeset
 preserves the sidebars and their widgets, providing a migration path to a
 block theme without losing the widgets.

 Classic sidebars are now:

 * Stored in a new theme mod called `'wp_classic_sidebars'`;
 * Restored to the `$wp_registered_sidebars` global variable when the
 `'widgets_init'` action fires (via a new internal function called
 `_wp_block_theme_register_classic_sidebars()`);
 * And marked as `'inactive'` when interacting with sidebars REST API
 endpoint.

 References:
 * [https://github.com/WordPress/gutenberg/pull/45509 Gutenberg PR 45509]
 which adds an option for importing widgets from sidebars into template
 parts.

 Follow-up to [50995], [6334].

 Props mamaduka, audrasjb, hellofromTonya, ironprogrammer, jameskoster,
 joen, matveb, mukesh27, noisysocks, poena, youknowriad.
 Fixes #57531.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57531#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list