mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
Editor: Extend register_block_type to accept the path file or folder with block.json
Rather than using two distinct methods to register block types in WordPress core, let's make `register_block_type` the canonical method to deal with all use cases. In practice, the patch proposed extends its usage to work as a proxy to `register_block_type_from_metadata`. It should remove some confusion that we observed and let us be more explicit what's the latest recommendation. Props matveb, mcsf. Fixes #53233. git-svn-id: https://develop.svn.wordpress.org/trunk@50927 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -59,7 +59,7 @@ function register_core_block_types_from_metadata() {
|
||||
);
|
||||
|
||||
foreach ( $block_folders as $block_folder ) {
|
||||
register_block_type_from_metadata(
|
||||
register_block_type(
|
||||
ABSPATH . WPINC . '/blocks/' . $block_folder
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user