Skip to content

Instantly share code, notes, and snippets.

@nicomollet
Last active April 16, 2019 10:01
Show Gist options
  • Select an option

  • Save nicomollet/14419de376db6b2a3132e04ce72ed06c to your computer and use it in GitHub Desktop.

Select an option

Save nicomollet/14419de376db6b2a3132e04ce72ed06c to your computer and use it in GitHub Desktop.
WooCommerce Memberships, removes the "My Memberships" table from my account area
<?php
function woocommerce_remove_my_memberships_table() {
if ( function_exists( 'wc_memberships' )
&& method_exists( wc_memberships(), 'get_frontend_instance' )
&& method_exists( wc_memberships()->get_frontend_instance(), 'get_members_area_instance' )
) {
remove_filter( 'woocommerce_account_menu_items',
array( wc_memberships()->get_frontend_instance()->get_members_area_instance(), 'add_account_members_area_menu_item' ), 999 );
}
}
add_action( 'init', 'woocommerce_remove_my_memberships_table' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment