Automattic\WooCommerce\EmailEditor\Engine\Renderer\ContentRenderer\Preprocessors
Blocks_Width_Preprocessor::parse_number_from_string_with_pixels
Parse number from string with pixels
Method of the class: Blocks_Width_Preprocessor{}
No Hooks.
Returns
float.
Usage
// private - for code of main (parent) class only $result = $this->parse_number_from_string_with_pixels( $value ): float;
- $value(string) (required)
- Value with pixels.
Blocks_Width_Preprocessor::parse_number_from_string_with_pixels() Blocks Width Preprocessor::parse number from string with pixels code WC 10.6.2
private function parse_number_from_string_with_pixels( string $value ): float {
return (float) str_replace( 'px', '', $value );
}