Make WordPress Core


Ignore:
Timestamp:
06/23/2021 01:07:27 AM (4 years ago)
Author:
desrosj
Message:

Widgets: Add support for the Widgets Editor on after_setup_theme instead of widgets_init.

This better aligns with developer expectations, as add_theme_support() and remove_theme_support() are meant to be called within functions attached to the after_setup_theme hook.

This also adds the widgets-block-editor feature to the docblock for add_theme_support().

Props kevin940726, caseymilne, jamesros161, noisysocks, Mamaduka, audrasjb, zieladam, hellofromTonya, desrosj.
Fixes #53424.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r51197 r51214  
    24802480 * @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'.
    24812481 * @since 5.6.0 The `post-formats` feature warns if no array is passed.
     2482 * @since 5.8.0 The `widgets-block-editor` enables the Widgets block editor.
    24822483 *
    24832484 * @global array $_wp_theme_features
     
    25122513 *                          - 'wp-block-styles'
    25132514 *                          - 'widgets'
     2515 *                          - 'widgets-block-editor'
    25142516 * @param mixed  ...$args Optional extra arguments to pass along with certain features.
    25152517 * @return void|false Void on success, false on failure.
Note: See TracChangeset for help on using the changeset viewer.