WPML

问题概述

在使用 The Events Calendar (TEC) 插件并将 WPML 配置为每种语言使用不同的域名的网站上,切换语言时事件链接可能会显示不正确的 URL。

临时解决方法

在继续操作之前,请确保对您的站点进行完整备份。

  • 打开 …/wp-content/plugins/events-calendar-pro/src/Events_Pro/Custom_Tables/V1/Integrations/WPML/WPML_Integration.php 文件。
  • 找到第 97 行。
  • 将:
    // Remove the home URL from permalink.
    $post_link = str_replace( array( home_url( '/' ), site_url( '/' ) ), '', $post_link );
  • 替换为:
    // Remove the home URL from permalink.
    $post_link = str_replace( array( home_url( '/' ), site_url( '/' ), get_option( 'home' ) ), '', $post_link );

所有已知问题