Astra_Enqueue_Scripts::trim_css( string $css = '' )

Trim CSS


Description


Parameters

$css

(string) (Optional) CSS content to trim.

Default value: ''


Return

(string)


Source

File: inc/core/class-astra-enqueue-scripts.php

		public static function trim_css( $css = '' ) {

			// Trim white space for faster page loading.
			if ( ! empty( $css ) ) {
				$css = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css );
				$css = str_replace( array( "\r\n", "\r", "\n", "\t", '  ', '    ', '    ' ), '', $css );
				$css = str_replace( ', ', ',', $css );
			}

			return $css;
		}

Changelog

Changelog
Version Description
1.0.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.