public
Created

Gets rid of WordPress's (annoying) usage of querystrings for versioning.

  • Download Gist
no_querystrings.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12
<?php
 
add_action( 'wp_enqueue_scripts', 'piss_off_query_strings' );
function piss_off_query_strings() {
global $wp_scripts, $wp_styles;
foreach( (array) $wp_scripts->registered as $handle => $obj ) {
$wp_scripts->registered[$handle]->ver = null;
}
foreach( (array) $wp_styles->registered as $handle => $obj ) {
$wp_styles->registered[$handle]->ver = null;
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.