Created
June 23, 2020 07:52
-
-
Save danieliser/c7af8757cd0276c9a2ef1fbdb40d0bfd to your computer and use it in GitHub Desktop.
Force Popup Maker asset caching on.
This file contains 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( 'wp_enqueue_scripts', 'custom_force_pm_asset_caching', 11 ); | |
function custom_force_pm_asset_caching() { | |
wp_deregister_script( 'popup-maker-site' ); | |
$cached = get_option( 'pum-has-cached-js' ); | |
if ( ! $cached ) { | |
PUM_AssetCache::cache_js(); | |
$cached = get_option( 'pum-has-cached-js' ); | |
} | |
wp_register_script( 'popup-maker-site', PUM_Site_Assets::$cache_url . '/' . PUM_AssetCache::generate_cache_filename( 'pum-site-scripts' ) . '.js?generated=' . $cached, array( 'jquery', 'jquery-ui-core', 'jquery-ui-position' ), Popup_Maker::$VER, true ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment