-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added cache busting support #14
base: master
Are you sure you want to change the base?
Conversation
wp-h5p-xapi.php
Outdated
@@ -19,10 +19,10 @@ | |||
|
|||
function h5pxapi_enqueue_scripts() | |||
{ | |||
wp_register_script("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.js", array("jquery")); | |||
wp_register_script("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.js", array("jquery"), filemtime(), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SteelWagstaff filemtime()
needs to reference a file, so (as per the example in your issue) it should be something like:
- wp_register_script("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.js", array("jquery"), filemtime(), true);
+ wp_register_script("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.js", array("jquery"), filemtime( __FILE__ ), true);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SteelWagstaff This PR won't work as is, see comments re: filemtime().
wp-h5p-xapi.php
Outdated
wp_enqueue_script("wp-h5p-xapi"); | ||
|
||
wp_register_style("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.css"); | ||
wp_register_style("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.css", array(), filemtime(), 'all'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here.
Added version numbers with last modified date references to enqueued css and js files