[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/block-supports/ -> spacing.php (summary)

Spacing block support flag. For backwards compatibility, this remains separate to the dimensions.php block support despite both belonging under a single panel in the editor.

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

Defines 3 functions

  wp_register_spacing_support()
  wp_apply_spacing_support()
  wp_get_spacing_classes_and_styles()

Functions
Functions that are not part of a class:

wp_register_spacing_support( $block_type )   X-Ref
Registers the style block attribute for block types that support it.

param: WP_Block_Type $block_type Block Type.

wp_apply_spacing_support( $block_type, $block_attributes )   X-Ref
Adds CSS classes for block spacing to the incoming attributes array.
This will be applied to the block markup in the front-end.

param: WP_Block_Type $block_type       Block Type.
param: array         $block_attributes Block attributes.
return: array Block spacing CSS classes and inline styles.

wp_get_spacing_classes_and_styles( $block_attributes )   X-Ref
Returns spacing classes and inline styles for block attributes, like the JS
`getSpacingClassesAndStyles()`. Does not check block support or skipped
serialization.

param: array<string, mixed> $block_attributes Block attributes.
return: array<string, string> Array with `class` and `style` keys, each present only when non-empty.



Generated : Fri Nov 27 08:20:01 2026 Cross-referenced by PHPXref