CSS - Remove Versioning

PHOTO EMBED

Thu Mar 11 2021 16:17:14 GMT+0000 (UTC)

Saved by @info2grow #php #css #javascript

add_filter( 'style_loader_src',  'sdt_remove_ver_css_js', 9999, 2 );
add_filter( 'script_loader_src', 'sdt_remove_ver_css_js', 9999, 2 );

function sdt_remove_ver_css_js( $src, $handle ) 
{
    $handles_with_version = [ 'style','general' ]; // <-- Adjust to your needs!
    if ( strpos( $src, 'ver=' ) && ! in_array( $handle, $handles_with_version, true ) )
        $src = remove_query_arg( 'ver', $src );
    return $src;
}
content_copyCOPY

Remove versioning from styles and scripts

https://codeanywhere.com/editor/