mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51421 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -86,63 +86,3 @@ function register_block_core_post_template() {
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'register_block_core_post_template' );
|
||||
|
||||
/**
|
||||
* Renders the legacy `core/query-loop` block on the server.
|
||||
* It triggers a developer warning and then calls the renamed
|
||||
* block's `render_callback` function output.
|
||||
*
|
||||
* This can be removed when WordPress 5.9 is released.
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
*
|
||||
* @return string Returns the output of the query, structured using the layout defined by the block's inner blocks.
|
||||
*/
|
||||
function render_legacy_query_loop_block( $attributes, $content, $block ) {
|
||||
trigger_error(
|
||||
/* translators: %1$s: Block type */
|
||||
sprintf( __( 'Block %1$s has been renamed to Post Template. %1$s will be supported until WordPress version 5.9.' ), $block->name ),
|
||||
headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE
|
||||
);
|
||||
return render_block_core_post_template( $attributes, $content, $block );
|
||||
}
|
||||
|
||||
/**
|
||||
* Complements the renaming of `Query Loop` to `Post Template`.
|
||||
* This ensures backwards compatibility for any users running the Gutenberg
|
||||
* plugin who have used Query Loop prior to its renaming.
|
||||
*
|
||||
* This can be removed when WordPress 5.9 is released.
|
||||
*
|
||||
* @see https://github.com/WordPress/gutenberg/pull/32514
|
||||
*/
|
||||
function gutenberg_register_legacy_query_loop_block() {
|
||||
$registry = WP_Block_Type_Registry::get_instance();
|
||||
if ( $registry->is_registered( 'core/query-loop' ) ) {
|
||||
unregister_block_type( 'core/query-loop' );
|
||||
}
|
||||
register_block_type(
|
||||
'core/query-loop',
|
||||
array(
|
||||
'category' => 'design',
|
||||
'uses_context' => array(
|
||||
'queryId',
|
||||
'query',
|
||||
'queryContext',
|
||||
'displayLayout',
|
||||
'templateSlug',
|
||||
),
|
||||
'supports' => array(
|
||||
'reusable' => false,
|
||||
'html' => false,
|
||||
'align' => true,
|
||||
),
|
||||
'style' => 'wp-block-post-template',
|
||||
'render_callback' => 'render_legacy_query_loop_block',
|
||||
'skip_inner_blocks' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action( 'init', 'gutenberg_register_legacy_query_loop_block' );
|
||||
|
||||
Reference in New Issue
Block a user