Skip to content

Instantly share code, notes, and snippets.

Created April 13, 2017 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b60201ec42cfd00ead82e82954a5dd3d to your computer and use it in GitHub Desktop.
Save anonymous/b60201ec42cfd00ead82e82954a5dd3d to your computer and use it in GitHub Desktop.
Reordering / Adding To WooCommerce My Account Page Menu
<?php
/*
* Change the order of the endpoints that appear in My Account Page - WooCommerce 2.6
* More Info: http://wpbeaches.com/change-rename-woocommerce-endpoints-accounts-page/
*/
function wpb_woo_my_account_order() {
$myorder = array(
'dashboard' => __( 'My Account', 'woocommerce' ),
'directory_dashboard' => __( 'Listing Dashboard', 'woocommerce' ),
'orders' => __( 'Pending / Paid Listing Orders', 'woocommerce' ),
'cart' => __( 'Listings Awaiting Payment', 'woocommerce' ),
'edit-account' => __( 'Change My Details', 'woocommerce' ),
'customer-logout' => __( 'Logout', 'woocommerce' ),
);
return $myorder;
}
add_filter ( 'woocommerce_account_menu_items', 'wpb_woo_my_account_order' );
function wpb_woo_endpoint_title( $title, $id ) {
if ( is_wc_endpoint_url( 'dashboard' ) && in_the_loop() ) { // add your endpoint urls
$title = "My Account"; // change your entry-title
}
return $title;
}
add_filter( 'the_title', 'wpb_woo_endpoint_title', 10, 2 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment