wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_add_parent_layout_to_parsed_block › WordPress Function

Seit6.6.0
Veraltetn/v
wp_add_parent_layout_to_parsed_block ( $parsed_block, $source_block, $parent_block )
Zugriff:
  • private
Parameter: (3)
  • (array) $parsed_block The parsed block.
    Erforderlich: Ja
  • (array) $source_block The source block.
    Erforderlich: Ja
  • (WP_Block) $parent_block The parent block.
    Erforderlich: Ja
Gibt zurück:
  • (array) The parsed block with parent layout attribute if it exists.
Definiert in:
Codex:

Check if the parent block exists and if it has a layout attribute.

If it does, add the parent layout to the parsed block


Quellcode

function wp_add_parent_layout_to_parsed_block( $parsed_block, $source_block, $parent_block ) {
	if ( $parent_block && isset( $parent_block->parsed_block['attrs']['layout'] ) ) {
		$parsed_block['parentLayout'] = $parent_block->parsed_block['attrs']['layout'];
	}
	return $parsed_block;
}