【发布时间】:2020-10-30 15:22:27
【问题描述】:
我有一个自定义的 myaccount 页面,我想在其中显示 dashboard.php。我们如何在短代码中嵌入dashboard.php 模板(我的帐户“仪表板”)?
基于 How can we display the edit account form using shortcode? 对我之前问题的回答,我在functions.php 中尝试了以下操作:
//[account_dashboard]
add_shortcode('account_dashboard', 'display_account_dashboard');
function display_account_dashboard()
{
return WC_Shortcode_My_Account::dashboard();
}
但它不起作用
【问题讨论】:
-
刚刚更新了我的代码……有些东西不见了。
标签: php wordpress templates woocommerce shortcode