Last active
November 22, 2021 03:33
-
-
Save AmeliaBriscoe/c49700487be15e17791ea2ebfe156dff to your computer and use it in GitHub Desktop.
Example filters to change a label in My Account, or remove it
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 | |
/* rename the Membership tab in My account | |
*/ | |
add_filter( 'woocommerce_account_menu_items', 'wcs_rename_membership_my_account', 999 ); | |
function wcs_rename_membership_my_account( $items ) { | |
$items['members-area'] = 'Custom Tab Title'; | |
return $items; | |
} | |
/* remove the Subscriptions tab in My account */ | |
add_filter( 'woocommerce_account_menu_items', 'wcs_remove_mysubscriptions_my_account', 999 ); | |
function wcs_remove_mysubscriptions_my_account( $items ) { | |
unset($items['subscriptions']); | |
return $items; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment