Last active
April 16, 2019 10:01
-
-
Save nicomollet/14419de376db6b2a3132e04ce72ed06c to your computer and use it in GitHub Desktop.
WooCommerce Memberships, removes the "My Memberships" table from my account area
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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