简体   繁体   中英

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.

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.

删除下载链接

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

[data-tab="downloads"] {
    display: none!important;
}

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