Make WordPress Core


Ignore:
Timestamp:
05/30/2024 07:33:23 AM (19 months ago)
Author:
isabel_brison
Message:

Editor: allow registering block styles for multiple block types.

Updates the WP_Block_Styles_Registry class to allow registering an array of blocks.

Props aaronrobertshaw, talldanwp, isabel_brison.
Fixes #61274.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r58186 r58246  
    19031903 *
    19041904 * @since 5.3.0
     1905 * @since 6.6.0 Updated types as registry now allows registering styles for multiple block types at once.
    19051906 *
    19061907 * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/
    19071908 *
    1908  * @param string $block_name       Block type name including namespace.
    1909  * @param array  $style_properties Array containing the properties of the style name, label,
    1910  *                                 style_handle (name of the stylesheet to be enqueued),
    1911  *                                 inline_style (string containing the CSS to be added).
    1912  *                                 See WP_Block_Styles_Registry::register().
     1909 * @param string|array $block_name       Block type name including namespace or array of namespaced block type names.
     1910 * @param array        $style_properties Array containing the properties of the style name, label,
     1911 *                                       style_handle (name of the stylesheet to be enqueued),
     1912 *                                       inline_style (string containing the CSS to be added),
     1913 *                                       style_data (theme.json-like array to generate CSS from).
     1914 *                                       See WP_Block_Styles_Registry::register().
    19131915 * @return bool True if the block style was registered with success and false otherwise.
    19141916 */
Note: See TracChangeset for help on using the changeset viewer.