0

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

1
  • Looks like it's probably expecting a slug and as such is sanitizing it for use in a URL, instead of being a path like you're expecting Jul 9 at 13:58
0

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.