Automattic\WooCommerce\EmailEditor\Integrations\Utils

Table_Wrapper_Helper::build_attributes_stringprivate staticWC 1.0

Build an HTML attributes string from an array.

Method of the class: Table_Wrapper_Helper{}

No Hooks.

Returns

String. The attributes string.

Usage

$result = Table_Wrapper_Helper::build_attributes_string( $attributes ): string;
$attributes(array) (required)
.

Table_Wrapper_Helper::build_attributes_string() code WC 10.5.0

private static function build_attributes_string( array $attributes ): string {
	$attr_parts = array();
	foreach ( $attributes as $key => $value ) {
		if ( '' !== $value ) {
			$attr_parts[] = sprintf( '%s="%s"', $key, esc_attr( $value ) );
		}
	}
	return implode( ' ', $attr_parts );
}