[ 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: 1087 lines (38 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  wp_get_layout_definitions()
  wp_register_layout_support()
  wp_get_layout_style()
  wp_render_layout_support_flag()
  wp_add_parent_layout_to_parsed_block()
  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.

return: string CSS styles on success. Else, empty string.
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.

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

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

wp_add_parent_layout_to_parsed_block( $parsed_block, $source_block, $parent_block )   X-Ref
Check if the parent block exists and if it has a layout attribute.
If it does, add the parent layout to the parsed block

return: array The parsed block with parent layout attribute if it exists.
param: array    $parsed_block The parsed block.
param: array    $source_block The source block.
param: WP_Block $parent_block The parent block.

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.

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

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



Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref