This will add a custom menu link in your Woocommece client dashboard, this will link off to your desired page.
How to Setup Snippet
Add this to your functions.php file
// Adds custom dasboard link to a page
add_filter ( 'woocommerce_account_menu_items', 'tunez_one_more_link' );
function tunez_one_more_link( $menu_links ){
// We will hook "sometext" later
$new = array( 'wantlist' => 'Want List' );
// Or in case you need 2 links
// $new = array( 'link1' => 'Link 1', 'link2' => 'Link 2' );
// array_slice() is good when you want to add an element between the other ones
$menu_links = array_slice( $menu_links, 0, 3, true )
+ $new
+ array_slice( $menu_links, 3, NULL, true );
return $menu_links;
}
add_filter( 'woocommerce_get_endpoint_url', 'tunez_hook_endpoint', 10, 4 );
function tunez_hook_endpoint( $url, $endpoint, $value, $permalink ){
if( $endpoint === 'wantlist' ) {
// Here is the place for your custom URL, it could be external
$url = site_url( '/wantlist/' );
}
return $url;
}