Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors

Spacing_Preprocessor::has_explicit_horizontal_padding │ private │ WC 1.0

Checks whether a block explicitly defines any horizontal padding.

Containers with explicit padding (any value) manage their own layout and should stop delegating root padding to their children.

Метод класса: Spacing_Preprocessor{}

Хуков нет.

Возвращает

bool. True if the block defines horizontal padding.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->has_explicit_horizontal_padding( $block ): bool;
$block(массив) (обязательный)
The block to check.

Код Spacing_Preprocessor::has_explicit_horizontal_padding() WC 11.2.2

private function has_explicit_horizontal_padding( array $block ): bool {
	$padding = $block['attrs']['style']['spacing']['padding'] ?? array();
	return isset( $padding['left'] ) || isset( $padding['right'] );
}