Skip to content
wpbeaches
  • Home
  • About
  • Services
  • Work
    • Template Library
    • Web Development
    • Portfolio
  • Contact
  • Blog
    • ACF
    • Beaver
      • Beaver Builder
      • Beaver Theme
      • Beaver Themer
    • Genesis
    • jQuery
    • macOS
    • WordPress
    • WooCommerce

Change, Edit & Rename WooCommerce Endpoints in My Accounts Page

November 18, 2017 - 26 Comments

Here is how you can change, edit and rename WooCommerce Endpoints in My Accounts Page.

Since the release of WooCommerce 2.6 Woo has a revamped My-Account page, it appears as a vertical menu of links that display the corresponding table of data to the right, similar to a tabbed layout. This certainly is a better user experience than the previous continuous rolling display of data.

my account custom endpoints

The usual data found on the My Account page will be in this format including WooCommerce subscriptions and memberships. These segments are contained in what is called endpoints.

Changing the My Account Endpoints Order

The original order of the My Account menu items can be seen in /wp-content/plugins/woocommerce/includes/wc-account-functions.php

/**
 * Get My Account menu items.
 *
 * @since 2.6.0
 * @return array
 */
function wc_get_account_menu_items() {
 return apply_filters( 'woocommerce_account_menu_items', array(
 'dashboard' => __( 'Dashboard', 'woocommerce' ),
 'orders' => __( 'Orders', 'woocommerce' ),
 'downloads' => __( 'Downloads', 'woocommerce' ),
 'edit-address' => __( 'Addresses', 'woocommerce' ),
 'payment-methods' => __( 'Payment Methods', 'woocommerce' ),
 'edit-account' => __( 'Account Details', 'woocommerce' ),
 'customer-logout' => __( 'Logout', 'woocommerce' ),
 ) );
}

You can change the order of these endpoints by using the woocommerce_account_menu_items filter, you can also change the list item title with the same filter.

One of the limitations with changing the list item title is that it won’t change the entry-title.

woocommerce-entry-title

 

To remove an item from the my-account dashboard don’t include it in the returned array that you are passing in via the filter woocommerce_account_menu_items

Changing the Entry Title of the Custom Endpoint

One way around changing the entry-title of the WooCommerce custom endpoint is to use the_title filter with the in_the_loop conditional.

woocommerce-entry-title-filtered

Now the entry title, as well as the list item title, are changed.

 

Adding a Custom Endpoint

@claudiosmweb has published an example of how to add a new custom endpoint to the menu list on the My Account page, which is great as you can add any additional data into it.

So in the code above you add as a plugin, I have added the plugin header, so just add in your plugins folder and activate and then flush your permalinks. Change the content where applicable it is set up to use ‘My Stuff‘ as the Entry Title with an endpoint as my-custom-endpoint and an echo of Hello World.

To change the custom endpoint URL just change it and ensure you change the corresponding URL value in anything added in via the filter in woocommerce_account_menu_items

Adding Content to the Custom Endpoint

To change the content itself you can add in a template or use a woo provided filter…

add_action( 'woocommerce_account_my-stuff-endpoint_endpoint', 'gc_custom_endpoint_content' );
/**
 * Custom Endpoint content
 */
function gc_custom_endpoint_content() {
 echo 'custom end point content goes here';
}

So in the above, the action used is woocommerce_account_{your-custom-url}_endpoint – just hook in your content.

Related Posts:

  • Pre Get Posts Display
    Change Number of Posts Displaying on a Custom Post…
  • Wordpress Table Prefix
    Change WordPress Database Table Prefix Back To wp_
  • Woocommerce Stuck Action Scheduler
    Reducing Table Size of WooCommerce Scheduler Actions…
  • Woocommerce Dot Navigation
    Add Dot Pagination to WooCommerce Product Gallery…
  • Add Shortcode Hook Woocommerce
    Add a WooCommerce missing action hook with shortcode…
Categorized WordPress Tagged endpoints, my-account-page, woocommerce
Get Beaver Builder Now!

Tags

ACF apache archive beaver beaver builder beaver theme beaver themer bootstrap category cpt css customizer fail2ban filter flexbox footer form genesis header homebrew htaccess iconfonts image javascript jquery loop markup menu meta mysql php repeater runcloud search filter pro serverpilot shortcode slider taxonomy template ubuntu UI/UX while widget woocommerce wp-cli
PowerPack Beaver Builder Addon

Our Location

We are based in the Northern Beaches of Sydney and work with both local and overseas based clients.

Work With Us

Let us know your web requirements, see our services and use the contact form to get in touch and start the ball rolling.

Check Us Out

  • Home
  • Blog
  • About
  • Services

© 2017 · NEIL GOWRAN · POWERED BY WORDPRESS, BEAVER, OPEN LITESPEED, CLOUDFLARE AND HOSTED ON RUNCLOUD AND RACKNERD

Scroll To Top