WooCommerce - Remove downloads from menu in my account page

后端 未结 3 1785
温柔的废话
温柔的废话 2020-12-12 19:37

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?

Than

相关标签:
3条回答
  • 2020-12-12 19:46
    [data-tab="downloads"] {
        display: none!important;
    }
    
    0 讨论(0)
  • 2020-12-12 19:55

    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

    0 讨论(0)
  • 2020-12-12 19:57

    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.

    0 讨论(0)
提交回复
热议问题