WP_Block_Styles_Registry::is_registered() WordPress Method
The WP_Block_Styles_Registry::is_registered() method is used to check if a given style has been registered with the block styles system. This is useful for checking if a given style is available to be used by blocks, before trying to use it.
WP_Block_Styles_Registry::is_registered( string $block_name, string $block_style_name ) #
Checks if a block style is registered for the given block type.
Parameters
- $block_name
(string)(Required)Block type name including namespace.
- $block_style_name
(string)(Required)Block style name.
Return
(bool) True if the block style is registered, false otherwise.
Source
File: wp-includes/class-wp-block-styles-registry.php
public function is_registered( $block_name, $block_style_name ) { return isset( $this->registered_block_styles[ $block_name ][ $block_style_name ] ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.3.0 | Introduced. |