register_block_style

Advertisement

Summery Summery

Registers a new block style.

Syntax Syntax

register_block_style( string $block_name, array $style_properties )

Parameters Parameters

$block_name

(string) (Required) Block type name including namespace.

$style_properties

(array) (Required) Array containing the properties of the style name, label, style (name of the stylesheet to be enqueued), inline_style (string containing the CSS to be added).

Return Return

(boolean) True if the block style was registered with success and false otherwise.

Source Source

File: wp-includes/blocks.php

function register_block_style( $block_name, $style_properties ) {
	return WP_Block_Styles_Registry::get_instance()->register( $block_name, $style_properties );
}

Advertisement

Changelog Changelog

Changelog
Version Description
5.3.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.