[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

Layout block support flag.

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

Defines 6 functions

  wp_get_layout_definitions()
  wp_register_layout_support()
  wp_get_layout_style()
  wp_render_layout_support_flag()
  wp_restore_group_inner_container()
  wp_restore_image_outer_container()

Functions
Functions that are not part of a class:

wp_get_layout_definitions()   X-Ref
Returns layout definitions, keyed by layout type.

Provides a common definition of slugs, classnames, base styles, and spacing styles for each layout type.
When making changes or additions to layout definitions, the corresponding JavaScript definitions should
also be updated.

return: array[] Layout definitions.

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

param: WP_Block_Type $block_type Block Type.

wp_get_layout_style( $selector, $layout, $has_block_gap_support = false, $gap_value = null, $should_skip_gap_serialization = false, $fallback_gap_value = '0.5em', $block_spacing = null )   X-Ref
Generates the CSS corresponding to the provided layout.

param: string               $selector                      CSS selector.
param: array                $layout                        Layout object. The one that is passed has already checked
param: bool                 $has_block_gap_support         Optional. Whether the theme has support for the block gap. Default false.
param: string|string[]|null $gap_value                     Optional. The block gap value to apply. Default null.
param: bool                 $should_skip_gap_serialization Optional. Whether to skip applying the user-defined value set in the editor. Default false.
param: string               $fallback_gap_value            Optional. The block gap value to apply. Default '0.5em'.
param: array|null           $block_spacing                 Optional. Custom spacing set on the block. Default null.
return: string CSS styles on success. Else, empty string.

wp_render_layout_support_flag( $block_content, $block )   X-Ref
Renders the layout config to the block wrapper.

param: string $block_content Rendered block content.
param: array  $block         Block object.
return: string Filtered block content.

wp_restore_group_inner_container( $block_content, $block )   X-Ref
For themes without theme.json file, make sure
to restore the inner div for the group block
to avoid breaking styles relying on that div.

param: string $block_content Rendered block content.
param: array  $block         Block object.
return: string Filtered block content.

wp_restore_image_outer_container( $block_content, $block )   X-Ref
No description



Generated : Thu Mar 28 08:20:01 2024 Cross-referenced by PHPXref