Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks

Group::remove_horizontal_paddingprivateWC 1.0

Remove horizontal padding properties from compiled cell styles.

Used when suppress-horizontal-padding is set to prevent the group from applying its own horizontal padding (which has been distributed per-block by the Spacing_Preprocessor).

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

Хуков нет.

Возвращает

Массив. Styles with horizontal padding removed.

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

// private - только в коде основоного (родительского) класса
$result = $this->remove_horizontal_padding( $cell_styles ): array;
$cell_styles(массив) (обязательный)
The compiled cell styles from Styles_Helper::get_block_styles().

Код Group::remove_horizontal_padding() WC 11.0.1

private function remove_horizontal_padding( array $cell_styles ): array {
	if ( ! isset( $cell_styles['declarations'] ) || ! is_array( $cell_styles['declarations'] ) ) {
		return $cell_styles;
	}

	unset(
		$cell_styles['declarations']['padding-left'],
		$cell_styles['declarations']['padding-right']
	);

	// Rebuild CSS string from remaining declarations.
	return Styles_Helper::extend_block_styles( $cell_styles, array() );
}