Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move image and gallery blocks to dynamic block registration #2009

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/wp-includes/blocks/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
require ABSPATH . WPINC . '/blocks/calendar.php';
require ABSPATH . WPINC . '/blocks/categories.php';
require ABSPATH . WPINC . '/blocks/file.php';
require ABSPATH . WPINC . '/blocks/gallery.php';
require ABSPATH . WPINC . '/blocks/image.php';
require ABSPATH . WPINC . '/blocks/latest-comments.php';
require ABSPATH . WPINC . '/blocks/latest-posts.php';
require ABSPATH . WPINC . '/blocks/legacy-widget.php';
Expand Down Expand Up @@ -64,11 +66,9 @@ function register_core_block_types_from_metadata() {
'cover',
'embed',
'freeform',
'gallery',
'group',
'heading',
'html',
'image',
'list',
'media-text',
'missing',
Expand Down
2 changes: 2 additions & 0 deletions tests/phpunit/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ function _unhook_block_registration() {
remove_action( 'init', 'register_block_core_calendar' );
remove_action( 'init', 'register_block_core_categories' );
remove_action( 'init', 'register_block_core_file' );
remove_action( 'init', 'gutenberg_register_block_core_gallery', 20 );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: Remove gutenberg_ prefix.

remove_action( 'init', 'register_block_core_image' );
remove_action( 'init', 'register_block_core_latest_comments' );
remove_action( 'init', 'register_block_core_latest_posts' );
remove_action( 'init', 'register_block_core_legacy_widget' );
Expand Down
4 changes: 2 additions & 2 deletions tools/webpack/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ module.exports = function( env = { environment: 'production', watch: false, buil
'calendar',
'categories',
'file',
'gallery',
'image',
'latest-comments',
'latest-posts',
'loginout',
Expand Down Expand Up @@ -73,11 +75,9 @@ module.exports = function( env = { environment: 'production', watch: false, buil
'cover',
'embed',
'freeform',
'gallery',
'group',
'heading',
'html',
'image',
'list',
'media-text',
'missing',
Expand Down