Changeset 59201
- Timestamp:
- 10/09/2024 10:09:30 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-template.php
r59073 r59201 378 378 * @return WP_Block_Template|WP_Error The registered template object on success, WP_Error object on failure. 379 379 */ 380 function wp_register_block_template( $template_name, $args = array() ) {380 function register_block_template( $template_name, $args = array() ) { 381 381 return WP_Block_Templates_Registry::get_instance()->register( $template_name, $args ); 382 382 } … … 391 391 * template doesn't exist. 392 392 */ 393 function wp_unregister_block_template( $template_name ) {393 function unregister_block_template( $template_name ) { 394 394 return WP_Block_Templates_Registry::get_instance()->unregister( $template_name ); 395 395 } -
trunk/tests/phpunit/tests/block-template.php
r59073 r59201 444 444 $template_name = 'test-plugin//test-template'; 445 445 446 wp_register_block_template( $template_name );446 register_block_template( $template_name ); 447 447 448 448 $templates = get_block_templates(); … … 450 450 $this->assertArrayHasKey( $template_name, $templates ); 451 451 452 wp_unregister_block_template( $template_name );452 unregister_block_template( $template_name ); 453 453 } 454 454 … … 466 466 ); 467 467 468 wp_register_block_template( $template_name, $args );468 register_block_template( $template_name, $args ); 469 469 470 470 $template = get_block_template( 'block-theme//test-template' ); … … 472 472 $this->assertSame( 'Test Template', $template->title ); 473 473 474 wp_unregister_block_template( $template_name );474 unregister_block_template( $template_name ); 475 475 } 476 476 -
trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php
r59073 r59201 547 547 ); 548 548 549 wp_register_block_template( $template_name, $args );549 register_block_template( $template_name, $args ); 550 550 551 551 $request = new WP_REST_Request( 'GET', '/wp/v2/templates/test-plugin//test-template' ); … … 567 567 $this->assertSame( 'test-plugin', $data['plugin'], 'Plugin name mismatch.' ); 568 568 569 wp_unregister_block_template( $template_name );569 unregister_block_template( $template_name ); 570 570 571 571 $request = new WP_REST_Request( 'GET', '/wp/v2/templates/test-plugin//test-template' );
Note: See TracChangeset
for help on using the changeset viewer.