[英]WooCommerce - Remove downloads from menu in my account page
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.谢谢。
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这段代码已经过测试并且可以正常工作
[data-tab="downloads"] {
display: none!important;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.