[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> class-wp-block-styles-registry.php (summary)

Blocks API: WP_Block_Styles_Registry class

File Size: 203 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  register()
  unregister()
  get_registered()
  get_all_registered()
  get_registered_styles_for_block()
  is_registered()
  get_instance()

Functions
Functions that are not part of a class:

register( $block_name, $style_properties )   X-Ref
Registers a block style for the given block type.

If the block styles are present in a standalone stylesheet, register it and pass
its handle as the `style_handle` argument. If the block styles should be inline,
use the `inline_style` argument. Usually, one of them would be used to pass CSS
styles. However, you could also skip them and provide CSS styles in any stylesheet
or with an inline tag.

param: string|string[] $block_name       Block type name including namespace or array of namespaced block type names.
param: array           $style_properties {
return: bool True if the block style was registered with success and false otherwise.

unregister( $block_name, $block_style_name )   X-Ref
Unregisters a block style of the given block type.

param: string $block_name       Block type name including namespace.
param: string $block_style_name Block style name.
return: bool True if the block style was unregistered with success and false otherwise.

get_registered( $block_name, $block_style_name )   X-Ref
Retrieves the properties of a registered block style for the given block type.

param: string $block_name       Block type name including namespace.
param: string $block_style_name Block style name.
return: array Registered block style properties.

get_all_registered()   X-Ref
Retrieves all registered block styles.

return: array[] Array of arrays containing the registered block styles properties grouped by block type.

get_registered_styles_for_block( $block_name )   X-Ref
Retrieves registered block styles for a specific block type.

param: string $block_name Block type name including namespace.
return: array[] Array whose keys are block style names and whose values are block style properties.

is_registered( $block_name, $block_style_name )   X-Ref
Checks if a block style is registered for the given block type.

param: string $block_name       Block type name including namespace.
param: string $block_style_name Block style name.
return: bool True if the block style is registered, false otherwise.

get_instance()   X-Ref
Utility method to retrieve the main instance of the class.

The instance will be created if it does not exist yet.

return: WP_Block_Styles_Registry The main instance.



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref