php WooCommerce - 从我的帐户页面的菜单中删除下载
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39287308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WooCommerce - Remove downloads from menu in my account page
提问by techiva.blogspot.in
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.
谢谢。
回答by Christophvh
回答by LoicTheAztec
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.
此代码位于活动子主题(或主题)的 function.php 文件或任何插件文件中。
This code is tested and working
这段代码已经过测试并且可以正常工作
回答by Sean
[data-tab="downloads"] {
display: none!important;
}


