Make WordPress Core


Ignore:
Timestamp:
07/13/2021 04:39:05 PM (4 years ago)
Author:
youknowriad
Message:

Block Editor: Include the fixes targetted for WordPress 5.8 RC3.

This includes the following fixes:

  • Safari: see if compositing layer size is more reasonable when position fixed divs are not inserted into content.
  • Site Logo Block: update Site Logo block UI and option syncing.
  • Fix moving inner blocks in the Widgets Customizer.
  • Allow themes to provide empty values for color.duotone and spacing.units
  • Update getTermsInfo() to workaround parsing issue for translatable strings.
  • Specify what settings can be part of settings.layout.
  • Update conditions to hide duotone panel.
  • Prevent entering invalid values in the Query Loop block config.
  • Prevent color panel from showing as empty.
  • Avoid calling gutenberg_ functions within code shipped through WordPress Core.

Props desrosj.
See #53397.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/post-template.php

    r51199 r51421  
    8787}
    8888add_action( 'init', 'register_block_core_post_template' );
    89 
    90 /**
    91  * Renders the legacy `core/query-loop` block on the server.
    92  * It triggers a developer warning and then calls the renamed
    93  * block's `render_callback` function output.
    94  *
    95  * This can be removed when WordPress 5.9 is released.
    96  *
    97  * @param array    $attributes Block attributes.
    98  * @param string   $content    Block default content.
    99  * @param WP_Block $block      Block instance.
    100  *
    101  * @return string Returns the output of the query, structured using the layout defined by the block's inner blocks.
    102  */
    103 function render_legacy_query_loop_block( $attributes, $content, $block ) {
    104     trigger_error(
    105         /* translators: %1$s: Block type */
    106         sprintf( __( 'Block %1$s has been renamed to Post Template. %1$s will be supported until WordPress version 5.9.' ), $block->name ),
    107         headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
    108     );
    109     return render_block_core_post_template( $attributes, $content, $block );
    110 }
    111 
    112 /**
    113  * Complements the renaming of `Query Loop` to `Post Template`.
    114  * This ensures backwards compatibility for any users running the Gutenberg
    115  * plugin who have used Query Loop prior to its renaming.
    116  *
    117  * This can be removed when WordPress 5.9 is released.
    118  *
    119  * @see https://github.com/WordPress/gutenberg/pull/32514
    120  */
    121 function gutenberg_register_legacy_query_loop_block() {
    122     $registry = WP_Block_Type_Registry::get_instance();
    123     if ( $registry->is_registered( 'core/query-loop' ) ) {
    124         unregister_block_type( 'core/query-loop' );
    125     }
    126     register_block_type(
    127         'core/query-loop',
    128         array(
    129             'category'          => 'design',
    130             'uses_context'      => array(
    131                 'queryId',
    132                 'query',
    133                 'queryContext',
    134                 'displayLayout',
    135                 'templateSlug',
    136             ),
    137             'supports'          => array(
    138                 'reusable' => false,
    139                 'html'     => false,
    140                 'align'    => true,
    141             ),
    142             'style'             => 'wp-block-post-template',
    143             'render_callback'   => 'render_legacy_query_loop_block',
    144             'skip_inner_blocks' => true,
    145         )
    146     );
    147 }
    148 add_action( 'init', 'gutenberg_register_legacy_query_loop_block' );
Note: See TracChangeset for help on using the changeset viewer.