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

Blocks_Width_Preprocessor::parse_number_from_string_with_pixels │ private │ WC 1.0

Parse number from string with pixels

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

Хуков нет.

Возвращает

float.

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

// private - только в коде основоного (родительского) класса
$result = $this->parse_number_from_string_with_pixels( $value ): float;
$value(строка) (обязательный)
Value with pixels.

Код Blocks_Width_Preprocessor::parse_number_from_string_with_pixels() WC 11.2.2

private function parse_number_from_string_with_pixels( string $value ): float {
	return (float) str_replace( 'px', '', $value );
}