Login
登录 注册 安全退出
当前位置: 首页 > 文章中心 > 技术教程 > wordpress如何禁用谷歌地图

wordpress如何禁用谷歌地图

时间:2025-10-29浏览: [ ]

wordpress如何禁用谷歌地图

许多主题和插件都将google maps api与它捆绑在一起,这可能会破坏您的性能优化工作。虽然google maps api是在异步中加载的,但它确实会大幅增加页面的总加载时间。

/*
*  Remove Google Maps API Call
*/
function disable_google_map_api($load_google_map_api) {
  $load_google_map_api = false;
  return $load_google_map_api;
}
$plugins = get_option('active_plugins');
$required_plugin = 'auto-location-pro/auto-location.php';
if ( in_array( $required_plugin , $plugins ) ) {
  add_filter('avf_load_google_map_api', 'disable_google_map_api', 10, 1);
}
登录后复制
模板文件不存在: ./template/plugins/zan/pc/index.htm
复制本文链接文章为作者独立观点不代表优设网立场,未经允许不得转载。