Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Layout

Flex_Layout_Renderer::get_width_without_gap │ private │ WC 1.0

How much of width we will strip to keep some space for the gap This is computed based on CSS rule used in the editor: For block with width set to X percent width: calc(X% - (var(--wp--style--block-gap) * (100 - X)/100)));

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

Хуков нет.

Возвращает

int.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_width_without_gap( $block_width, $flex_gap, $block_width_percent ): int;
$block_width(float) (обязательный)
Block width in pixels.
$flex_gap(float) (обязательный)
Flex gap in pixels.
$block_width_percent(float) (обязательный)
Block width in percent.

Код Flex_Layout_Renderer::get_width_without_gap() WC 11.3.0

private function get_width_without_gap( float $block_width, float $flex_gap, float $block_width_percent ): int {
	$width_gap_reduction = $flex_gap * ( ( 100 - $block_width_percent ) / 100 );
	return intval( floor( $block_width - $width_gap_reduction ) );
}