Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors
Spacing_Preprocessor::preprocess_with_context
Preprocesses the parsed blocks with rendering context.
Метод класса: Spacing_Preprocessor{}
Хуков нет.
Возвращает
array.
Использование
$Spacing_Preprocessor = new Spacing_Preprocessor(); $Spacing_Preprocessor->preprocess_with_context( $parsed_blocks, $layout, $styles, ?Rendering_Context $rendering_context ): array;
- $parsed_blocks(массив) (обязательный)
- Parsed blocks.
- $layout(массив) (обязательный)
- Layout.
- $styles(массив) (обязательный)
- Styles.
- ?Rendering_Context $rendering_context
- .
По умолчанию:null
Код Spacing_Preprocessor::preprocess_with_context() Spacing Preprocessor::preprocess with context WC 11.2.2
public function preprocess_with_context( array $parsed_blocks, array $layout, array $styles, ?Rendering_Context $rendering_context = null ): array {
$root_padding = $this->get_root_padding( $styles );
$container_padding = $styles['__container_padding'] ?? array();
$variables_map = $styles['__variables_map'] ?? array();
$gap_padding_side = $rendering_context && $rendering_context->is_rtl() ? 'padding-right' : 'padding-left';
$parsed_blocks = $this->add_block_gaps(
$parsed_blocks,
$styles['spacing']['blockGap'] ?? '',
null,
$root_padding,
false,
$container_padding,
$variables_map,
$gap_padding_side
);
return $parsed_blocks;
}