|
@@ -46,8 +46,11 @@ remove_action('wp_head', 'feed_links', 2 );
|
|
|
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
|
|
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
|
|
|
remove_action('wp_head', 'wp_oembed_add_host_js', 10);
|
|
remove_action('wp_head', 'wp_oembed_add_host_js', 10);
|
|
|
|
|
|
|
|
|
|
+// Strip only the WordPress *core* version from asset URLs (mild version hiding).
|
|
|
|
|
+// Leave other ?ver values intact so filemtime cache-busters keep working —
|
|
|
|
|
+// otherwise browsers cache CSS/JS forever and never see a rebuild.
|
|
|
function dw_remove_wp_ver_css_js( $src ) {
|
|
function dw_remove_wp_ver_css_js( $src ) {
|
|
|
- if ( strpos( $src, 'ver=' ) )
|
|
|
|
|
|
|
+ if ( strpos( $src, 'ver=' . $GLOBALS['wp_version'] ) !== false )
|
|
|
$src = remove_query_arg( 'ver', $src );
|
|
$src = remove_query_arg( 'ver', $src );
|
|
|
return $src;
|
|
return $src;
|
|
|
}
|
|
}
|