wp/wp-includes/blocks/block.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-includes/blocks/block.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/blocks/block.php	Tue Dec 15 13:49:49 2020 +0100
@@ -29,15 +29,15 @@
 	return do_blocks( $reusable_block->post_content );
 }
 
-register_block_type(
-	'core/block',
-	array(
-		'attributes'      => array(
-			'ref' => array(
-				'type' => 'number',
-			),
-		),
-
-		'render_callback' => 'render_block_core_block',
-	)
-);
+/**
+ * Registers the `core/block` block.
+ */
+function register_block_core_block() {
+	register_block_type_from_metadata(
+		__DIR__ . '/block',
+		array(
+			'render_callback' => 'render_block_core_block',
+		)
+	);
+}
+add_action( 'init', 'register_block_core_block' );