我试图在一个子主题中覆盖这个Dokan插件文件:
wp-content/plugins/dokan-pro/includes/modules/vendor-verification/templates/verification-new.php我可以成功地覆盖“普通Dokan模板”文件夹中的文件:
wp-content/plugins/dokan-pro/templates/path-to-file.php通过使用
wp-content/themes/theme-child/dokan/path-to-file.php但是,由于我希望覆盖的文件位于includes文件夹中,所以我很难找到正确的文件路径来覆盖验证-new.php文件。
有什么想法吗?
我之所以希望覆盖子主题中的文件,而不是简单地编辑原始文件,是因为我可以更新Dokan,而不会丢失更改。
发布于 2022-04-28 09:23:31
要更新乔·科洛夫的答案,它几乎成功了。但你必须改变这句话:
add_filter('dokan_locate_template', 'childtheme_dokan_locate_template', 20, 3);致:
add_filter('dokan_get_template_part', 'childtheme_dokan_locate_template', 20, 3);https://wordpress.stackexchange.com/questions/352413
复制相似问题