From 8fafc11932a7c7f37187530bdbca7d699e865276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=83=C2=B3=C3=85=E2=80=9Akowski?= Date: Tue, 19 Apr 2022 11:35:50 +0000 Subject: [PATCH] Editor: Correctly register the dynamic Cover block The new "Featured Image" enhancement is handled dynamically, so we need to update how the Cover block is handled in the build processa and registered in the code. Props ironprogrammer, costdev, Mamaduka, chaion07. Fixes #55580. git-svn-id: https://develop.svn.wordpress.org/trunk@53212 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/blocks/index.php | 2 +- tests/phpunit/includes/functions.php | 1 + tools/webpack/blocks.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/blocks/index.php b/src/wp-includes/blocks/index.php index ce5d4fde71..60ab8e572f 100644 --- a/src/wp-includes/blocks/index.php +++ b/src/wp-includes/blocks/index.php @@ -21,6 +21,7 @@ require ABSPATH . WPINC . '/blocks/comments-pagination-next.php'; require ABSPATH . WPINC . '/blocks/comments-pagination-numbers.php'; require ABSPATH . WPINC . '/blocks/comments-pagination-previous.php'; require ABSPATH . WPINC . '/blocks/comments-pagination.php'; +require ABSPATH . WPINC . '/blocks/cover.php'; require ABSPATH . WPINC . '/blocks/file.php'; require ABSPATH . WPINC . '/blocks/gallery.php'; require ABSPATH . WPINC . '/blocks/home-link.php'; @@ -79,7 +80,6 @@ function register_core_block_types_from_metadata() { 'code', 'column', 'columns', - 'cover', 'embed', 'freeform', 'group', diff --git a/tests/phpunit/includes/functions.php b/tests/phpunit/includes/functions.php index 29871c3d66..2836b4cb54 100644 --- a/tests/phpunit/includes/functions.php +++ b/tests/phpunit/includes/functions.php @@ -317,6 +317,7 @@ function _unhook_block_registration() { remove_action( 'init', 'register_block_core_comments_pagination_next' ); remove_action( 'init', 'register_block_core_comments_pagination_numbers' ); remove_action( 'init', 'register_block_core_comments_pagination_previous' ); + remove_action( 'init', 'register_block_core_cover' ); remove_action( 'init', 'register_block_core_file' ); remove_action( 'init', 'register_block_core_gallery' ); remove_action( 'init', 'register_block_core_home_link' ); diff --git a/tools/webpack/blocks.js b/tools/webpack/blocks.js index f3de0664e0..aacef1afa8 100644 --- a/tools/webpack/blocks.js +++ b/tools/webpack/blocks.js @@ -37,6 +37,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil 'comments-pagination-next', 'comments-pagination-numbers', 'comments-pagination-previous', + 'cover', 'file', 'gallery', 'home-link', @@ -87,7 +88,6 @@ module.exports = function( env = { environment: 'production', watch: false, buil 'column', 'columns', 'comments-query-loop', - 'cover', 'embed', 'freeform', 'group',