Created
October 10, 2016 13:35
-
-
Save richstrauss/c795075920dd8f327d15aae3f3822bcf to your computer and use it in GitHub Desktop.
Change WooCommerce endpoints order on 'My Account' page
This file contains 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 | |
/* | |
* Change the order of the endpoints that appear in My Account Page - WooCommerce 2.6 | |
* The first item in the array is the custom endpoint URL - ie http://mydomain.com/my-account/my-custom-endpoint | |
* Alongside it are the names of the list item Menu name that corresponds to the URL, change these to suit | |
*/ | |
function wpb_woo_my_account_order() { | |
$myorder = array( | |
'dashboard' => __( 'Account', 'woocommerce' ), | |
'edit-account' => __( 'Personal Info', 'woocommerce' ), | |
'orders' => __( 'Orders', 'woocommerce' ), | |
'subscriptions' => __( 'Subscriptions', 'woocommerce' ), | |
'edit-address' => __( 'Address', 'woocommerce' ), | |
'payment-methods' => __( 'Payment Methods', 'woocommerce' ), | |
); | |
return $myorder; | |
} | |
add_filter ( 'woocommerce_account_menu_items', 'wpb_woo_my_account_order' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment