Be careful, this might cause caching issues on your site. If you have a proxy caching system set up, your changes on your assets may not be reflected to the site.
function _remove_script_version( $src ){
$parts = explode( '?', $src );
if ( substr( $parts[0], 0, strlen( site_url() ) ) == site_url() ) {
return $parts[0];
}
return $src;
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
Code language: PHP (php)
Leave a Reply