简体   繁体   中英

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.

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" }

But this does not have subscriptions or an appointment menu.

I believe these were added through woocommerce_account_menu_items filter. 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.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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