我似乎无法wc_get_template()返回我的页面模板。我确定路径是正确的,我将它存储在我的子主题文件夹中,但是当我运行它时,我得到NULL. 你能看出这里有什么问题吗?
public function endpoint_content() {
// The template name.
$template_name = 'Students Details';
// (default: array())
$args = array();
// The template path.
$template_path = get_stylesheet_directory().'/woocommerce/myaccount/add_students.php';
// NOTICE! Understand what this does before running.
$res = wc_get_template($template_name, $args, $template_path, $template_path);
var_dump($res);
}
Run Code Online (Sandbox Code Playgroud)