需要使用functions.php覆盖wp-content\plugins\wc-fields-factory\includes\wcff-builder.php
吗?
我在stackoverflow上发现了许多类似的问题,但是没有正确的答案。
我的动作:
wp-content\plugins\wc-fields-factory\includes\wcff-builder.php
复制到wp-content\themes\child-theme\wc-fields-factory\wcff-builder-custom.php
wp-content\themes\child-theme\wc-fields-factory\wcff-builder-custom.php
中的某些代码。该文件中的类保持不变。原始文件通过以下方式连接:
文件wp-content\plugins\wc-fields-factory\includes\wcff-loader.php
包含以下行:
if (!defined('ABSPATH')) {exit;}
class Wcff_Loader {
// wp-content\plugins\wc-fields-factory\includes\wcff-builder.php which we need to redefine.
public function load_environment() {
include_once('wcff-builder.php');
}
}
有必要断开原始文件并包含我的自定义文件wp-content\themes\child-theme\wc-fields-factory\wcff-builder-custom.php