public function clean_asset_tags($tag)
    {
        \preg_match_all(
            "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!",
            $tag,
            $matches
        );
       
        if (empty($matches[2])) {
            return $tag;
        }

        $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media="' . $matches[3][0] . '"' : '';

        return "\t".'<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n";
    }
public function clean_asset_tags($tag)
    {
        \preg_match_all(
            "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!",
            $tag,
            $matches
        );
       
        if (empty($matches[2])) {
            return $tag;
        }

        $media = $matches[3][0] !== '' && $matches[3][0] !== 'all' ? ' media="' . $matches[3][0] . '"' : '';

        return "\t".'<link rel="stylesheet" href="' . $matches[2][0] . '"' . $media . '>' . "\n";
    }
public function clean_asset_tags ( $ tag ) { \ preg_match_all ( "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!" , $ tag , $ matches ) ; if ( empty ( $ matches [ 2 ] ) ) { return $ tag ; } $ media = $ matches [ 3 ] [ 0 ] !== '' && $ matches [ 3 ] [ 0 ] !== 'all' ? ' media="' . $ matches [ 3 ] [ 0 ] . '"' : '' ; return "\t" . '<link rel="stylesheet" href="' . $ matches [ 2 ] [ 0 ] . '"' . $ media . '>' . "\n" ; }
Remove un needed attributes from asset tags.

@since  1.0.0

@param  string $tag Original asset tag.
@return string
Remove un needed attributes from asset tags .