diff --git a/src/wp-includes/block-template.php b/src/wp-includes/block-template.php index d42a74479c4e3..2a75231ae4e90 100644 --- a/src/wp-includes/block-template.php +++ b/src/wp-includes/block-template.php @@ -377,7 +377,7 @@ function _resolve_template_for_new_post( $wp_query ) { * } * @return WP_Block_Template|WP_Error The registered template object on success, WP_Error object on failure. */ -function wp_register_block_template( $template_name, $args = array() ) { +function register_block_template( $template_name, $args = array() ) { return WP_Block_Templates_Registry::get_instance()->register( $template_name, $args ); } @@ -390,6 +390,6 @@ function wp_register_block_template( $template_name, $args = array() ) { * @return WP_Block_Template|WP_Error The unregistered template object on success, WP_Error object on failure or if the * template doesn't exist. */ -function wp_unregister_block_template( $template_name ) { +function unregister_block_template( $template_name ) { return WP_Block_Templates_Registry::get_instance()->unregister( $template_name ); } diff --git a/tests/phpunit/tests/block-template.php b/tests/phpunit/tests/block-template.php index 9ec506a414a46..d88895c872be1 100644 --- a/tests/phpunit/tests/block-template.php +++ b/tests/phpunit/tests/block-template.php @@ -443,13 +443,13 @@ public function test_get_block_templates_paths_dir_doesnt_exists() { public function test_get_block_templates_from_registry() { $template_name = 'test-plugin//test-template'; - wp_register_block_template( $template_name ); + register_block_template( $template_name ); $templates = get_block_templates(); $this->assertArrayHasKey( $template_name, $templates ); - wp_unregister_block_template( $template_name ); + unregister_block_template( $template_name ); } /** @@ -465,13 +465,13 @@ public function test_get_block_template_from_registry() { 'title' => 'Test Template', ); - wp_register_block_template( $template_name, $args ); + register_block_template( $template_name, $args ); $template = get_block_template( 'block-theme//test-template' ); $this->assertSame( 'Test Template', $template->title ); - wp_unregister_block_template( $template_name ); + unregister_block_template( $template_name ); } /** diff --git a/tests/phpunit/tests/rest-api/wpRestTemplatesController.php b/tests/phpunit/tests/rest-api/wpRestTemplatesController.php index db0183aa78986..ad8cf945f971e 100644 --- a/tests/phpunit/tests/rest-api/wpRestTemplatesController.php +++ b/tests/phpunit/tests/rest-api/wpRestTemplatesController.php @@ -546,7 +546,7 @@ public function test_get_item_from_registry() { 'post_types' => array( 'post', 'page' ), ); - wp_register_block_template( $template_name, $args ); + register_block_template( $template_name, $args ); $request = new WP_REST_Request( 'GET', '/wp/v2/templates/test-plugin//test-template' ); $response = rest_get_server()->dispatch( $request ); @@ -566,7 +566,7 @@ public function test_get_item_from_registry() { $this->assertSame( 'Test Template', $data['title']['rendered'], 'Template title mismatch.' ); $this->assertSame( 'test-plugin', $data['plugin'], 'Plugin name mismatch.' ); - wp_unregister_block_template( $template_name ); + unregister_block_template( $template_name ); $request = new WP_REST_Request( 'GET', '/wp/v2/templates/test-plugin//test-template' ); $response = rest_get_server()->dispatch( $request );