Make WordPress Core

Changeset 51061


Ignore:
Timestamp:
06/02/2021 01:56:35 AM (3 years ago)
Author:
noisysocks
Message:

Widgets: Add missing actions to widgets block editor

Adds the 'sidebar_admin-setup', 'sidebar_admin_page', and
current_theme_supports( 'widgets' ) check to the widgets block editor so that
the block editor screen is more compatible with the classic screen.

Fixes #53288.
Props isabel_brison.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/widgets-form-blocks.php

    r51039 r51061  
    5656do_action( 'enqueue_block_editor_assets' );
    5757
     58/** This action is documented in wp-admin/widgets-form.php */
     59do_action( 'sidebar_admin_setup' );
     60
    5861require_once ABSPATH . 'wp-admin/admin-header.php';
    5962
     
    6568
    6669<?php
     70/** This action is documented in wp-admin/widgets-form.php */
     71do_action( 'sidebar_admin_page' );
     72
    6773require_once ABSPATH . 'wp-admin/admin-footer.php';
  • trunk/src/wp-admin/widgets-form.php

    r50997 r51061  
    7272    '<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    7373);
    74 
    75 if ( ! current_theme_supports( 'widgets' ) ) {
    76     wp_die( __( 'The theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="https://developer.wordpress.org/themes/functionality/widgets/">follow these instructions</a>.' ) );
    77 }
    7874
    7975// These are the widgets grouped by sidebar.
  • trunk/src/wp-admin/widgets.php

    r50996 r51061  
    2121}
    2222
     23if ( ! current_theme_supports( 'widgets' ) ) {
     24    wp_die( __( 'The theme you are currently using isn&#8217;t widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please <a href="https://developer.wordpress.org/themes/functionality/widgets/">follow these instructions</a>.' ) );
     25}
     26
    2327$title       = __( 'Widgets' );
    2428$parent_file = 'themes.php';
Note: See TracChangeset for help on using the changeset viewer.