简体   繁体   English

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

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

I am trying to get all the menu items under the WooCommerce My account but it returns only the default items.我正在尝试获取 WooCommerce 我的帐户下的所有菜单项,但它仅返回默认项。

This function wc_get_account_menu_items() returns 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" }这个 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" }

But this does not have subscriptions or an appointment menu.但这没有订阅或约会菜单。

I believe these were added through woocommerce_account_menu_items filter.我相信这些是通过woocommerce_account_menu_items过滤器添加的。 But how can I have the current list of current menus with links?但是我怎样才能获得带有链接的当前菜单的当前列表?

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

It prints all the menus.它打印所有菜单。

在此处输入图像描述

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

相关问题 在Woocommerce中获取作为“自定义我的帐户”页面内容分页的未购买商品 - Get unpurchased items paginated as Custom My account page content in Woocommerce 重新排列Woocommerce我的帐户部分中的菜单项 - Reorder menu items in Woocommerce My Account section 如何获得我在Woocommerce中所有订阅的列表? - How to get a list of all my subscriptions in Woocommerce? WooCommerce 我的账户页面城市下拉列表 - WooCommerce dropdown list of cities in My Account page 在 WooCommerce 中设置我的帐户自定义项目端点标题 - Set My Account custom items endpoints titles in WooCommerce 在 Woocommerce 的我的帐户订单视图页面上添加 sku 以订购商品 - Add the sku to order items on my account order view pages in Woocommerce 从 Woocommerce 中的我的帐户订单表中删除项目计数 - Remove items count from my account orders table in Woocommerce 如何在“我的帐户”页面的“WooCommerce 我的订单”列表中添加自定义数据作为新列? - How to Add Custom Data as a New Column in the WooCommerce My Orders list in My Account page? 如何删除我的帐户 Woocommerce 中的白线? - How to remove white line in My Account Woocommerce? Woocommerce - 如何使用 elementor 编辑仪表板我的帐户 - Woocommerce - How to edit dashboard my account with elementor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM