getAttribute( 'class' ) ), ...$classes, ] ); $class = str_replace( [ 'undefined', ' ' ], [ '', ' ' ], $class ); $first->setAttribute( 'class', $class ); $first->setAttribute( 'style', css_array_to_string( array_merge( css_string_to_array( $first->getAttribute( 'style' ) ), $custom_properties ) ) ); $content = $dom->saveHTML(); } return $content; }