Changeset 59073 for trunk/src/wp-includes/block-template.php
- Timestamp:
- 09/20/2024 02:05:50 AM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-template.php
r57785 r59073 359 359 } 360 360 } 361 362 /** 363 * Register a block template. 364 * 365 * @since 6.7.0 366 * 367 * @param string $template_name Template name in the form of `plugin_uri//template_name`. 368 * @param array|string $args { 369 * @type string $title Optional. Title of the template as it will be shown in the Site Editor 370 * and other UI elements. 371 * @type string $description Optional. Description of the template as it will be shown in the Site 372 * Editor. 373 * @type string $content Optional. Default content of the template that will be used when the 374 * template is rendered or edited in the editor. 375 * @type string[] $post_types Optional. Array of post types to which the template should be available. 376 * @type string $plugin Optional. Slug of the plugin that registers the template. 377 * } 378 * @return WP_Block_Template|WP_Error The registered template object on success, WP_Error object on failure. 379 */ 380 function wp_register_block_template( $template_name, $args = array() ) { 381 return WP_Block_Templates_Registry::get_instance()->register( $template_name, $args ); 382 } 383 384 /** 385 * Unregister a block template. 386 * 387 * @since 6.7.0 388 * 389 * @param string $template_name Template name in the form of `plugin_uri//template_name`. 390 * @return WP_Block_Template|WP_Error The unregistered template object on success, WP_Error object on failure or if the 391 * template doesn't exist. 392 */ 393 function wp_unregister_block_template( $template_name ) { 394 return WP_Block_Templates_Registry::get_instance()->unregister( $template_name ); 395 }
Note: See TracChangeset
for help on using the changeset viewer.