wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_add_parent_layout_to_parsed_block › WordPress Function

Depuis6.6.0
Dépréciéen/a
wp_add_parent_layout_to_parsed_block ( $parsed_block, $source_block, $parent_block )
Accès:
  • private
Paramètres: (3)
  • (array) $parsed_block The parsed block.
    Requis: Oui
  • (array) $source_block The source block.
    Requis: Oui
  • (WP_Block) $parent_block The parent block.
    Requis: Oui
Retourne:
  • (array) The parsed block with parent layout attribute if it exists.
Défini(e) dans:
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


Source

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;
}