Make WordPress Core


Ignore:
Timestamp:
06/08/2021 08:07:15 AM (3 years ago)
Author:
youknowriad
Message:

Block Editor: Package updates for 5.8 beta 1.

This includes the following fixes:

Widgets Editor:

Widget blocks in the customizer:

Global Styles:

Template Editor:

Miscellaneous:

Performance:

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/legacy-widget.php

    r51051 r51089  
    5151
    5252/**
    53  * On application init this does two things:
    54  *
    55  * - Registers the 'core/legacy-widget' block.
    56  * - Intercepts any request with legacy-widget-preview in the query param and,
    57  *   if set, renders a page containing a preview of the requested Legacy Widget
    58  *   block.
     53 * Registers the 'core/legacy-widget' block.
    5954 */
    60 function init_legacy_widget_block() {
     55function register_block_core_legacy_widget() {
    6156    register_block_type_from_metadata(
    6257        __DIR__ . '/legacy-widget',
     
    6560        )
    6661    );
     62}
    6763
     64add_action( 'init', 'register_block_core_legacy_widget' );
     65
     66/**
     67 * Intercepts any request with legacy-widget-preview in the query param and, if
     68 * set, renders a page containing a preview of the requested Legacy Widget
     69 * block.
     70 */
     71function handle_legacy_widget_preview_iframe() {
    6872    if ( empty( $_GET['legacy-widget-preview'] ) ) {
    6973        return;
     
    111115}
    112116
    113 add_action( 'init', 'init_legacy_widget_block' );
     117// Ensure handle_legacy_widget_preview_iframe() is called after Core's
     118// register_block_core_legacy_widget() (priority = 10) and after Gutenberg's
     119// register_block_core_legacy_widget() (priority = 20).
     120add_action( 'init', 'handle_legacy_widget_preview_iframe', 21 );
Note: See TracChangeset for help on using the changeset viewer.