Title: WP_Block_Styles_Registry::get_registered_styles_for_block
Published: November 12, 2019
Last modified: August 20, 2026

---

# WP_Block_Styles_Registry::get_registered_styles_for_block( string $block_name ): array[]

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#wp--skip-link--target)

Retrieves registered block styles for a specific block type.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#parameters)󠁿

 `$block_name`stringrequired

Block type name including namespace.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#return)󠁿

 array[] Array whose keys are block style names and whose values are block style
properties.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#source)󠁿

    ```php
    public function get_registered_styles_for_block( $block_name ) {
    	return $this->registered_block_styles[ $block_name ] ?? array();
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-block-styles-registry.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/class-wp-block-styles-registry.php#L172)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/class-wp-block-styles-registry.php#L172-L174)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_block_styles_registry/get_registered_styles_for_block/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.3.0](https://developer.wordpress.org/reference/since/5.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_block_styles_registry%2Fget_registered_styles_for_block%2F)
before being able to contribute a note or feedback.