WooCommerce - Remove downloads from menu in my account page

柔情痞子 提交于 2019-11-28 16:43:01

问题


I would like to remove downloads menu from my account page.

How can I do this? Is it any hook to remove a specific item from the menu?

Thanks.


回答1:


Go to WooCommerce > Settings > Advanced and remove the entry for Downloads in the Account endpoints section, just leave it blank. And the menu will not be visible anymore.




回答2:


You will need this lightly customized this code snippet:

function custom_my_account_menu_items( $items ) {
    unset($items['downloads']);
    return $items;
}
add_filter( 'woocommerce_account_menu_items', 'custom_my_account_menu_items' );

This code goes on function.php file of your active child theme (or theme) or in any plugin file.

This code is tested and working



来源:https://stackoverflow.com/questions/39287308/woocommerce-remove-downloads-from-menu-in-my-account-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!