Editor: Document the arguments for registering a block style.

See #55646

Built from https://develop.svn.wordpress.org/trunk@53892


git-svn-id: http://core.svn.wordpress.org/trunk@53451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2022-08-13 22:38:09 +00:00
parent 11a3a91511
commit e8a05d5082
3 changed files with 22 additions and 4 deletions

View File

@ -991,6 +991,8 @@ function block_version( $content ) {
* *
* @since 5.3.0 * @since 5.3.0
* *
* @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/
*
* @param string $block_name Block type name including namespace. * @param string $block_name Block type name including namespace.
* @param array $style_properties Array containing the properties of the style name, * @param array $style_properties Array containing the properties of the style name,
* label, style (name of the stylesheet to be enqueued), * label, style (name of the stylesheet to be enqueued),

View File

@ -34,12 +34,28 @@ final class WP_Block_Styles_Registry {
/** /**
* Registers a block style for the given block type. * Registers a block style for the given block type.
* *
* If the block styles are present in a standalone stylesheet, register it and pass
* its handle as the `style_handle` argument. If the block styles should be inline,
* use the `inline_style` argument. Usually, one of them would be used to pass CSS
* styles. However, you could also skip them and provide CSS styles in any stylesheet
* or with an inline tag.
*
* @since 5.3.0 * @since 5.3.0
* *
* @link https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/
*
* @param string $block_name Block type name including namespace. * @param string $block_name Block type name including namespace.
* @param array $style_properties Array containing the properties of the style name, label, * @param array $style_properties {
* is_default, style_handle (name of the stylesheet to be enqueued), * Array containing the properties of the style.
* inline_style (string containing the CSS to be added). *
* @type string $name The identifier of the style used to compute a CSS class.
* @type string $label A human-readable label for the style.
* @type string $inline_style Inline CSS code that registers the CSS class required
* for the style.
* @type string $style_handle The handle to an already registered style that should be
* enqueued in places where block styles are needed.
* @type bool $is_default Whether this is the default style for the block type.
* }
* @return bool True if the block style was registered with success and false otherwise. * @return bool True if the block style was registered with success and false otherwise.
*/ */
public function register( $block_name, $style_properties ) { public function register( $block_name, $style_properties ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.1-alpha-53891'; $wp_version = '6.1-alpha-53892';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.