register_block_pattern

The timeline below displays how wordpress function register_block_pattern has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.9

/**
 * Registers a new block pattern.
 *
 * @since 5.5.0
 *
 * @param string $pattern_name       Block pattern name including namespace.
 * @param array  $pattern_properties List of properties for the block pattern.
 *                                   See WP_Block_Patterns_Registry::register() for accepted arguments.
 * @return bool True if the pattern was registered with success and false otherwise.
 */
function register_block_pattern($pattern_name, $pattern_properties)
{
    return WP_Block_Patterns_Registry::get_instance()->register($pattern_name, $pattern_properties);
}

WordPress Version: 5.5

/**
 * Registers a new pattern.
 *
 * @since 5.5.0
 *
 * @param string $pattern_name       Pattern name including namespace.
 * @param array  $pattern_properties Array containing the properties of the pattern.
 * @return bool True if the pattern was registered with success and false otherwise.
 */
function register_block_pattern($pattern_name, $pattern_properties)
{
    return WP_Block_Patterns_Registry::get_instance()->register($pattern_name, $pattern_properties);
}