unregister_block_style( string $block_name, string $block_style_name )

Unregisters a block style.


Parameters Parameters

$block_name

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

$block_style_name

(string) (Required) Block style name.


Top ↑

Return Return

(bool) True if the block style was unregistered with success and false otherwise.


Top ↑

Source Source

File: wp-includes/blocks.php

function unregister_block_style( $block_name, $block_style_name ) {
	return WP_Block_Styles_Registry::get_instance()->unregister( $block_name, $block_style_name );
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Marie Comet

    The following code sample unregister the style named ‘fancy-quote’ from the core quote block:

    unregister_block_style( 'core/quote', 'fancy-quote' );

    Important: The function unregister_block_style only unregisters styles that were registered on the server using register_block_style. The function does not unregister a style registered using client-side code.

You must log in before being able to contribute a note or feedback.