WPML

问题概述

使用Elementor Pro和WPML构建并翻译弹出窗口时,已翻译弹出窗口的内联 CSS 可能无法正确渲染。这会导致原始版本和已翻译版本之间出现微小的视觉差异。

临时解决方法

此问题已在 WPML 4.7.0 中修复。 更新即可在您的站点上解决此问题,因此只有在您还无法更新时,才需要此临时解决方法。

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

  • 打开 …/wp-content/plugins/elementor-pro/modules/popup/tag.php 文件。
  • 找到第 99 行。
  • 将:
    public function render() {
    	$settings = $this->get_active_settings();
    
    	if ( 'close' === $settings['action'] ) {
    		$this->print_close_popup_link( $settings );
    
    		return;
    	}
    
    	$this->print_open_popup_link( $settings );
    }
  • 替换为:
    public function render() {
    	$settings = $this->get_active_settings();
    
    	if ( 'close' === $settings['action'] ) {
    		$this->print_close_popup_link( $settings );
    
    		return;
    	}
    
    	// WPML Workaround for compsupp-7039
    	if ( class_exists('Sitepress') && isset($settings['popup']) ) {
    		$settings['popup'] = apply_filters( 'wpml_object_id', $settings['popup'], get_post_type($settings['popup']) , TRUE  );
    	}
    
    	$this->print_open_popup_link( $settings );
    }

所有已知问题

仍然遇到此问题?

如果更新无法解决问题,请提出支持问题,我们将与您一起排查。