Skip to content

Instantly share code, notes, and snippets.

@dasbairagya
Last active July 5, 2018 04:42
Show Gist options
  • Select an option

  • Save dasbairagya/33319b940c3917ecab4384dc2bf821a1 to your computer and use it in GitHub Desktop.

Select an option

Save dasbairagya/33319b940c3917ecab4384dc2bf821a1 to your computer and use it in GitHub Desktop.
Modification of navigation menu on my account page in woocommerce
<?php
//modification of navigation menu on my account page
// Note the low hook priority, this should give to your other plugins the time to add their own items...
add_filter( 'woocommerce_account_menu_items', 'add_my_menu_items', 99, 1 );
function add_my_menu_items( $items ) {
$my_items = array(
// endpoint => label
'edit-account' => __( 'Account Information', 'my_plugin' ),
'orders' => __( 'My Orders', 'my_plugin' ),
'wishlist' => __( 'My Wishlist', 'my_plugin' ),
'edit-address' => __( 'Address Book', 'my_plugin' ),
);
$my_items = array_slice( $items, 0, 1, true ) +
$my_items +
array_slice( $items, 1, count( $items ), true );
return $my_items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment