Last active
August 20, 2017 11:17
-
-
Save robertuniqid/58a167a9d81abba20e5caa44be44c13a to your computer and use it in GitHub Desktop.
WPEP - Force Assets Refresh in the Admin by JS.
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 | |
add_action( 'admin_footer', function() { | |
echo '<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery( "#wpep-admin-style-css" ).each( function() { | |
var hrefAttribute = jQuery(this).attr("href"); | |
hrefAttribute += ( hrefAttribute.indexOf("?") === -1 ? "?" : "&" ) + "wpep-forced-refresh=" + "' . date("Y-m-d" ) . '"; | |
jQuery(this).attr( "href", hrefAttribute ); | |
}); | |
}); | |
</script>'; | |
}, 5000 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment