WPML
状态
已由作者解决
相关插件/主题
BeTheme
主题标签
Compatibility

问题概述

BeTheme 与 WPML 一起使用时,您可能会遇到一个问题:更新使用 Muffin Builder 创建的产品会导致其翻译无法在高级翻译编辑器 (ATE) 中完成。发生这种情况是由于缺少类引用,您将在“WPML > 支持 > ATE > 错误日志”中看到记录的致命错误:

PHP Fatal error:  Uncaught Error: Class "Mfn_Builder_Fields" not found in /wp-content/themes/betheme/functions/builder/class-mfn-builder-admin.php:77

临时解决方法

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


  • 打开 …/wp-content/themes/betheme/functions/theme-woocommerce.php 文件。

  • 找到第 1765 行。

  • 将以下内容:
    function mfn_on_product_updated( $post_ID, $post_after, $post_before ) {
    
      if ( get_post_type($post_ID) !== 'product' ) return;
    
      require_once(get_theme_file_path('/functions/builder/class-mfn-builder-admin.php'));
            


  • 替换为:
    function mfn_on_product_updated( $post_ID, $post_after, $post_before ) {
    
      if ( get_post_type($post_ID) !== 'product' ) return;
    
      require_once(get_theme_file_path('/functions/builder/class-mfn-builder-admin.php'));
      require_once(get_theme_file_path('/functions/builder/class-mfn-builder-fields.php'));
            

所有已知问题 →