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

Column::get_width_attribute_valueprivateWC 1.0

Returns a table cell width attribute value.

Method of the class: Column{}

No Hooks.

Returns

string.

Usage

// private - for code of main (parent) class only
$result = $this->get_width_attribute_value( $width ): string;
$width(string) (required)
Column width.

Column::get_width_attribute_value() code WC 11.0.1

private function get_width_attribute_value( $width ): string {
	$parsed_width = Styles_Helper::parse_value( $width );

	if ( is_string( $width ) && preg_match( '/%\s*$/', $width ) ) {
		return $parsed_width . '%';
	}

	return (string) $parsed_width;
}