Created
March 9, 2019 08:27
-
-
Save zeshanshani/06b5ae1fd78e41971dcca516ad0778be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy this line. | |
/** | |
* Remove Script Version | |
* | |
* This function removes the query string from the scripts and styles. | |
* | |
* Author: Zeshan Ahmed | |
* Author URI: https://zeshanahmed.com/ | |
* | |
* @param string $src Source of the script/style | |
* @author Zeshan Ahmed | |
* @return string | |
*/ | |
function wp_remove_script_version( $src ) { | |
$src_parts = explode( '?', $src ); | |
return $src_parts[0]; | |
} | |
add_filter( 'script_loader_src', 'wp_remove_script_version', 15, 1 ); | |
add_filter( 'style_loader_src', 'wp_remove_script_version', 15, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment