Skip to content

Instantly share code, notes, and snippets.

@richstrauss
Created October 10, 2016 13:35
Show Gist options
  • Save richstrauss/c795075920dd8f327d15aae3f3822bcf to your computer and use it in GitHub Desktop.
Save richstrauss/c795075920dd8f327d15aae3f3822bcf to your computer and use it in GitHub Desktop.
Change WooCommerce endpoints order on 'My Account' page
<?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