| @@ -20,17 +20,12 @@ | ||
| 20 | 20 | /** |
| 21 | 21 | * Registers the `core/shortcode` block on server. |
| 22 | 22 | */ |
| 23 | 23 | function gutenberg_register_block_core_shortcode() { |
| 24 | - $path = __DIR__ . '/shortcode/block.json'; | |
| 25 | - $metadata = json_decode( file_get_contents( $path ), true ); | |
| 26 | - register_block_type( | |
| 27 | - $metadata['name'], | |
| 28 | - array_merge( | |
| 29 | - $metadata, | |
| 30 | - array( | |
| 31 | - 'render_callback' => 'gutenberg_render_block_core_shortcode', | |
| 32 | - ) | |
| 24 | + register_block_type_from_metadata( | |
| 25 | + __DIR__ . '/shortcode', | |
| 26 | + array( | |
| 27 | + 'render_callback' => 'gutenberg_render_block_core_shortcode', | |
| 33 | 28 | ) |
| 34 | 29 | ); |
| 35 | 30 | } |
| 36 | 31 | add_action( 'init', 'gutenberg_register_block_core_shortcode', 20 ); |