Make WordPress Core

Changeset 53892


Ignore:
Timestamp:
08/13/2022 10:36:27 PM (22 months ago)
Author:
johnbillion
Message:

Editor: Document the arguments for registering a block style.

See #55646

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r53859 r53892  
    991991 *
    992992 * @since 5.3.0
     993 *
     994 * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/
    993995 *
    994996 * @param string $block_name       Block type name including namespace.
  • trunk/src/wp-includes/class-wp-block-styles-registry.php

    r52261 r53892  
    3535     * Registers a block style for the given block type.
    3636     *
     37     * If the block styles are present in a standalone stylesheet, register it and pass
     38     * its handle as the `style_handle` argument. If the block styles should be inline,
     39     * use the `inline_style` argument. Usually, one of them would be used to pass CSS
     40     * styles. However, you could also skip them and provide CSS styles in any stylesheet
     41     * or with an inline tag.
     42     *
    3743     * @since 5.3.0
    3844     *
     45     * @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/
     46     *
    3947     * @param string $block_name       Block type name including namespace.
    40      * @param array  $style_properties Array containing the properties of the style name, label,
    41      *                                 is_default, style_handle (name of the stylesheet to be enqueued),
    42      *                                 inline_style (string containing the CSS to be added).
     48     * @param array  $style_properties {
     49     *     Array containing the properties of the style.
     50     *
     51     *     @type string $name         The identifier of the style used to compute a CSS class.
     52     *     @type string $label        A human-readable label for the style.
     53     *     @type string $inline_style Inline CSS code that registers the CSS class required
     54     *                                for the style.
     55     *     @type string $style_handle The handle to an already registered style that should be
     56     *                                enqueued in places where block styles are needed.
     57     *     @type bool   $is_default   Whether this is the default style for the block type.
     58     * }
    4359     * @return bool True if the block style was registered with success and false otherwise.
    4460     */
Note: See TracChangeset for help on using the changeset viewer.