Last active
July 5, 2018 04:42
-
-
Save dasbairagya/33319b940c3917ecab4384dc2bf821a1 to your computer and use it in GitHub Desktop.
Modification of navigation menu on my account page in woocommerce
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 | |
| //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