Make WordPress Core


Ignore:
Timestamp:
12/03/2025 07:45:02 PM (6 months ago)
Author:
westonruter
Message:

Block Editor: Move Block Patterns API functions to block-patterns.php.

Follow-up to [48156].

Props anukasha, dhiraj0901, swissspidy, palak678, madhavishah01.
See #50445.
Fixes #64234.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-patterns-registry.php

    r60904 r61348  
    278278    }
    279279}
    280 
    281 /**
    282  * Registers a new block pattern.
    283  *
    284  * @since 5.5.0
    285  *
    286  * @param string $pattern_name       Block pattern name including namespace.
    287  * @param array  $pattern_properties List of properties for the block pattern.
    288  *                                   See WP_Block_Patterns_Registry::register() for accepted arguments.
    289  * @return bool True if the pattern was registered with success and false otherwise.
    290  */
    291 function register_block_pattern( $pattern_name, $pattern_properties ) {
    292     return WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties );
    293 }
    294 
    295 /**
    296  * Unregisters a block pattern.
    297  *
    298  * @since 5.5.0
    299  *
    300  * @param string $pattern_name Block pattern name including namespace.
    301  * @return bool True if the pattern was unregistered with success and false otherwise.
    302  */
    303 function unregister_block_pattern( $pattern_name ) {
    304     return WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name );
    305 }
Note: See TracChangeset for help on using the changeset viewer.