我目前正在WordPress网站上工作,该网站具有父子主题。
父主题在WordPress仪表板的顶部输出以下语句:
此主题需要以下插件:插件A,插件B,插件C等
在父主题的functions.php
文件中触发以下输出是以下代码:
require_once get_template_directory() . '/inc/plugins/class-tgm-plugin-activation.php';
有没有一种方法可以通过“儿童主题”的functions.php
禁用此功能?当然,我可以在“父主题”中将其注释掉,但是在以后的更新中可能会覆盖它。我确实尝试过将条目复制到Child Theme的functions.php
中,然后在其中进行注释,但这没有用。
最新努力
此主题需要以下插件:
get_template_directory() . '/inc/plugins/class-tgm-plugin-activation.php'
函数中的do_action( 'tgmpa_register' );
中的文件,在那里找到了上面的通知前缀。add_action
目录中找到do_action( 'tgmpa_register' );
的{{1}}。/inc/functions/tgm-functions.php
和add_action
都注释掉,并在孩子的do_action
文件中输入remove_action( 'tgmpa_register', 'register_required_plugins', 999 );
。不幸的是,以上两种方法均无效。我认为这是因为父目录functions.php
优先于子目录parent_theme/inc
?如果是这样,有没有办法改变这一点?