WP_Block_Styles_Registry::get_registered() WordPress Method

The WP_Block_Styles_Registry::get_registered() method is used to get a list of all registered block styles. This can be useful for plugins or themes that need to know what block styles are available.

WP_Block_Styles_Registry::get_registered( string $block_name, string $block_style_name ) #

Retrieves the properties of a registered block style for the given block type.


Parameters

$block_name

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

$block_style_name

(string)(Required)Block style name.


Top ↑

Return

(array) Registered block style properties.


Top ↑

Source

File: wp-includes/class-wp-block-styles-registry.php

	public function get_registered( $block_name, $block_style_name ) {
		if ( ! $this->is_registered( $block_name, $block_style_name ) ) {
			return null;
		}

		return $this->registered_block_styles[ $block_name ][ $block_style_name ];
	}


Top ↑

Changelog

Changelog
VersionDescription
5.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.