function truncateExportStylesheets( $type, $max = 1 ) {
		// This method only supports Prince stylesheets at the moment.
		if ( in_array( $type, [ 'prince' ], true ) ) {
			$stylesheets = scandir_by_date( Container::get( 'Sass' )->pathToUserGeneratedCss() );
			$max = absint( $max );
			$i = 1;
			foreach ( $stylesheets as $stylesheet ) {
				if ( preg_match( '/(' . $type . ')-([0-9]*)/', $stylesheet, $matches ) ) {
					if ( $i > $max ) {
						unlink( Container::get( 'Sass' )->pathToUserGeneratedCss() . '/' . $stylesheet );
					}
					$i++;
				}
			}
		}
	}
function truncateExportStylesheets( $type, $max = 1 ) {
		// This method only supports Prince stylesheets at the moment.
		if ( in_array( $type, [ 'prince' ], true ) ) {
			$stylesheets = scandir_by_date( Container::get( 'Sass' )->pathToUserGeneratedCss() );
			$max = absint( $max );
			$i = 1;
			foreach ( $stylesheets as $stylesheet ) {
				if ( preg_match( '/(' . $type . ')-([0-9]*)/', $stylesheet, $matches ) ) {
					if ( $i > $max ) {
						unlink( Container::get( 'Sass' )->pathToUserGeneratedCss() . '/' . $stylesheet );
					}
					$i++;
				}
			}
		}
	}
function truncateExportStylesheets ( $ type , $ max = 1 ) { // This method only supports Prince stylesheets at the moment. if ( in_array ( $ type , [ 'prince' ] , true ) ) { $ stylesheets = scandir_by_date ( Container :: get ( 'Sass' ) -> pathToUserGeneratedCss ( ) ) ; $ max = absint ( $ max ) ; $ i = 1 ; foreach ( $ stylesheets as $ stylesheet ) { if ( preg_match ( '/(' . $ type . ')-([0-9]*)/' , $ stylesheet , $ matches ) ) { if ( $ i > $ max ) { unlink ( Container :: get ( 'Sass' ) -> pathToUserGeneratedCss ( ) . '/' . $ stylesheet ) ; } $ i ++ ; } } } }
Remove all but the most recent compiled stylesheet.

@param string $type
@param int $max
Remove all but the most recent compiled stylesheet .