繁体   English   中英

WooCommerce 如何获取我的账户物品清单?

[英]WooCommerce how to get the list of my account items?

我正在尝试获取 WooCommerce 我的帐户下的所有菜单项,但它仅返回默认项。

这个 function wc_get_account_menu_items()返回array(6) { ["orders"]=> string(6) "orders" ["downloads"]=> string(9) "downloads" ["edit-address"]=> string(12) "edit-address" ["payment-methods"]=> string(15) "payment-methods" ["edit-account"]=> string(12) "edit-account" ["customer-logout"]=> string(15) "customer-logout" }

但这没有订阅或约会菜单。

我相信这些是通过woocommerce_account_menu_items过滤器添加的。 但是我怎样才能获得带有链接的当前菜单的当前列表?

echo '<pre>wc_get_account_menu_items:-';
print_r( wc_get_account_menu_items());
echo '</pre>';

它打印所有菜单。

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM