register_block_pattern_category

The timeline below displays how wordpress function register_block_pattern_category 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 pattern category.
 *
 * @since 5.5.0
 *
 * @param string $category_name       Pattern category name including namespace.
 * @param array  $category_properties List of properties for the block pattern.
 *                                    See WP_Block_Pattern_Categories_Registry::register() for
 *                                    accepted arguments.
 * @return bool True if the pattern category was registered with success and false otherwise.
 */
function register_block_pattern_category($category_name, $category_properties)
{
    return WP_Block_Pattern_Categories_Registry::get_instance()->register($category_name, $category_properties);
}

WordPress Version: 5.8

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

WordPress Version: 5.5

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