When working with WooCommerce in combination with other plugins that also have account-style areas on a site, it can make sense to choose one as the primary account area and link between them.
Here’s a snippet demonstrating how you can add custom links to a WooCommerce account menu and control the URL so the link takes the user to any URL you need. WooCommerce provides us with the necessary filters, we just need to implement this solution in two parts:
Part 1: Register the WooCommerce account menu item
First, we need to register the link ‘endpoint’ and link text with WooCommerce. This is then provided by the wc_get_account_menu_items()
function when the account menu markup is generated. WooCommerce assumes we’re registering a custom account sub page or ‘endpoint’ here.
Part 2: Override the menu item’s URL
In order to change the link’s URL, we need to use an additional filter. This allows us to send the user any where we like such as some protected site content or, in this case, a courses archive.