WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/06/2021 02:36:26 PM (3 months ago)
Author:
youknowriad
Message:

Block Editor: Update packages with latest fixes for 5.8 RC2

Includes the following fixes:

  • [Block Library]: Less warnings when blocks try to render themselves.
  • Reset z-index on focused widget form
  • Refactor appender margin.
  • Fix slash inserter for widgets screen.
  • Widget screens: set html block as freeform content handler.
  • Widget Block: widget_id is undefined when a widget is placed.
  • Add <CopyHandler> to WidgetAreasBlockEditorProvider
  • Add width: 100% to components-base-control inside wp-block-legacy-widget
  • [Widgets editor] Replace the "technical" error notice a more user-friendly one
  • Fix legacy widget height overflow
  • Fix "Select all" behavior in the editor
  • Increase specificity of the NoPreview CSS rules to avoid conflicts with theme styles
  • Fix move to widget area checkmark
  • Replace legacy widget icon with its new version
  • [Block Library - Query Loop]: Set default block variations not to inherit from global query

See #53397.

File:
1 edited

Legend:

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

    r51199 r51344  
    2626
    2727    $id_base = $attributes['idBase'];
    28     if ( method_exists( $wp_widget_factory, 'get_widget_key' ) ) {
    29         $widget_key = $wp_widget_factory->get_widget_key( $id_base );
     28    if ( method_exists( $wp_widget_factory, 'get_widget_key' ) && method_exists( $wp_widget_factory, 'get_widget_object' ) ) {
     29        $widget_key    = $wp_widget_factory->get_widget_key( $id_base );
     30        $widget_object = $wp_widget_factory->get_widget_object( $id_base );
    3031    } else {
    31         $widget_key = gutenberg_get_widget_key( $id_base );
     32        $widget_key    = gutenberg_get_widget_key( $id_base );
     33        $widget_object = gutenberg_get_widget_object( $id_base );
    3234    }
    3335
    34     if ( ! $widget_key ) {
     36    if ( ! $widget_key || ! $widget_object ) {
    3537        return '';
    3638    }
     
    4648    }
    4749
     50    $args = array(
     51        'widget_id'   => $widget_object->id,
     52        'widget_name' => $widget_object->name,
     53    );
     54
    4855    ob_start();
    49     the_widget( $widget_key, $instance );
     56    the_widget( $widget_key, $instance, $args );
    5057    return ob_get_clean();
    5158}
Note: See TracChangeset for help on using the changeset viewer.