wp/wp-includes/blocks/categories.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-includes/blocks/categories.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/blocks/categories.php	Tue Dec 15 13:49:49 2020 +0100
@@ -51,13 +51,11 @@
 		$class .= " {$attributes['className']}";
 	}
 
-	$block_content = sprintf(
+	return sprintf(
 		$wrapper_markup,
 		esc_attr( $class ),
 		$items_markup
 	);
-
-	return $block_content;
 }
 
 /**
@@ -91,12 +89,11 @@
  * Registers the `core/categories` block on server.
  */
 function register_block_core_categories() {
-	register_block_type(
-		'core/categories',
+	register_block_type_from_metadata(
+		__DIR__ . '/categories',
 		array(
 			'render_callback' => 'render_block_core_categories',
 		)
 	);
 }
-
 add_action( 'init', 'register_block_core_categories' );