wordpress - Wocomerce 使用 GeoIP2 而不是 GeoLite2
问题描述
我正在尝试在 Woocommerce 中使用MaxMind GeoLocation 数据库的付费版本,但找不到一种方法来集成它并像免费版本一样自动更新数据库?
我在课堂上看到WC_Integration_MaxMind_Database_Service
有一个过滤器来更新文件的路径,但文件名GeoLite2-Country
似乎固定在const
function plugin_woocommerce_new_maxmind_geolocation_database_path($database_path) {
$upload_dir = wp_upload_dir();
$database_path = trailingslashit($upload_dir['basedir']) . 'GeoIP2-City.mmdb';
return $database_path;
}
add_filter( 'woocommerce_maxmind_geolocation_database_path', 'plugin_woocommerce_new_maxmind_geolocation_database_path' )
解决方案
推荐阅读
- javascript - Twitter 是否支持 OAuth2 授权码流?
- php - For循环PHP检查值并满足条件
- php - 图返回错误:此授权码已被使用
- reactjs - Formik - “脏”应用于具有相同自定义组件的所有实例
- python - JSON 序列化程序的 StatementError
- vulkan - 管道在什么阶段使用帧缓冲区?
- python - 使用定义的锚点添加图片以进行绘图
- c# - 如何在具有一个数据库的两个系统上连接 c# 应用程序,两个应用程序都相同
- react-native - 使用带有 react-native-elements 的 Font Awesome
- android - 如何使用 OKHttp 监控正在加载哪些资源?