Billing detail page doesn't work after I've changed the order of the Woocommerce navigation

I've added the following function to change the order and translate my Woocommerce account navigation. It works perfectly, except for the edit-address/billing part:

function wpb_woo_my_account_order()
{
    $myorder = array(
        'dashboard' = __('Dashboard', 'woocommerce'),
        'wishlist' = __('Wishlist', 'woocommerce'),
        'edit-address/billing' = __('Billing details', 'woocommerce'),
        'edit-account' = __('Account details', 'woocommerce'),
        'customer-logout' = __('Logout', 'woocommerce'),
    );
    return $myorder;
}

add_filter('woocommerce_account_menu_items', 'wpb_woo_my_account_order');

When I go to my account and click on Billing details in the navigation, I get a page not found URL error. The URL is /edit-address%2Fbilling/ instead of /edit-address/billing/ The issue is that the / is replaced with %2F

Topic woocommerce-offtopic account functions php Wordpress

Category Web


There is an issue with the latest version of WPML that causes this problem. WPML has a quick fix for this: https://wpml.org/errata/endpoints-containing-slashes-are-incorrectly-encoded/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.