Skip to content

Instantly share code, notes, and snippets.

@kprajapatii
Last active January 10, 2017 09:49
Show Gist options
  • Save kprajapatii/4dd63b1eaa8ace3a358c2d07c6e012af to your computer and use it in GitHub Desktop.
Save kprajapatii/4dd63b1eaa8ace3a358c2d07c6e012af to your computer and use it in GitHub Desktop.
Fix HTML 5 Map and GD booster caching
if (!function_exists('gd_geodir_booster_exclude_js')) {
// Fix HTML 5 Map and GD booster caching
function gd_geodir_booster_exclude_js( $continue, $content ) {
if (strpos($content, "uscanadahtml5map_js_data=true") !== false || strpos($content, "var BPLA_data = {") !== false || strpos($content, "callback=bp_location_profile.initMap") !== false || strpos($content, "/bp-location-autocomplete.min.js") !== false || strpos($content, "/jquery.js") !== false || (strpos($content, "new FlaShopUSCanadaMap(") !== false && strpos($content, "html5map_onclick(") !== false)) {
$continue = true;
}
return $continue;
}
}
add_filter( 'geodir_booster_script_continue', 'gd_geodir_booster_exclude_js', 11, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment