Changeset 61348 for trunk/src/wp-includes/block-patterns.php
- Timestamp:
- 12/03/2025 07:45:02 PM (5 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/block-patterns.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-patterns.php
r59472 r61348 8 8 9 9 add_theme_support( 'core-block-patterns' ); 10 11 /** 12 * Registers a new block pattern. 13 * 14 * @since 5.5.0 15 * 16 * @param string $pattern_name Block pattern name including namespace. 17 * @param array $pattern_properties List of properties for the block pattern. 18 * See WP_Block_Patterns_Registry::register() for accepted arguments. 19 * @return bool True if the pattern was registered with success and false otherwise. 20 */ 21 function register_block_pattern( $pattern_name, $pattern_properties ) { 22 return WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties ); 23 } 24 25 /** 26 * Unregisters a block pattern. 27 * 28 * @since 5.5.0 29 * 30 * @param string $pattern_name Block pattern name including namespace. 31 * @return bool True if the pattern was unregistered with success and false otherwise. 32 */ 33 function unregister_block_pattern( $pattern_name ) { 34 return WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name ); 35 } 36 37 /** 38 * Registers a new pattern category. 39 * 40 * @since 5.5.0 41 * 42 * @param string $category_name Pattern category name including namespace. 43 * @param array $category_properties List of properties for the block pattern. 44 * See WP_Block_Pattern_Categories_Registry::register() for 45 * accepted arguments. 46 * @return bool True if the pattern category was registered with success and false otherwise. 47 */ 48 function register_block_pattern_category( $category_name, $category_properties ) { 49 return WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties ); 50 } 51 52 /** 53 * Unregisters a pattern category. 54 * 55 * @since 5.5.0 56 * 57 * @param string $category_name Pattern category name including namespace. 58 * @return bool True if the pattern category was unregistered with success and false otherwise. 59 */ 60 function unregister_block_pattern_category( $category_name ) { 61 return WP_Block_Pattern_Categories_Registry::get_instance()->unregister( $category_name ); 62 } 10 63 11 64 /**
Note: See TracChangeset
for help on using the changeset viewer.