Title: mic365's Replies | WordPress.org

---

# mic365

  [  ](https://wordpress.org/support/users/mic365/)

 *   [Profile](https://wordpress.org/support/users/mic365/)
 *   [Topics Started](https://wordpress.org/support/users/mic365/topics/)
 *   [Replies Created](https://wordpress.org/support/users/mic365/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/mic365/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/mic365/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/mic365/engagements/)
 *   [Favorites](https://wordpress.org/support/users/mic365/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Categories order in REST API endpoint](https://wordpress.org/support/topic/categories-order-in-rest-api-endpoint/)
 *  [mic365](https://wordpress.org/support/users/mic365/)
 * (@mic365)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/categories-order-in-rest-api-endpoint/#post-13020252)
 * Look it up on Google. I think there are even videos that show you how to do it.
   
   [https://www.google.com/search?q=how+to+write+wp+hooks](https://www.google.com/search?q=how+to+write+wp+hooks)
 * Good luck 🙂
    mic.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Categories ordering not working on REST API on 3.6.3](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/)
 *  Thread Starter [mic365](https://wordpress.org/support/users/mic365/)
 * (@mic365)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/#post-11683300)
 * We ended up hooking `woocommerce_rest_product_cat_query` and setting `$prepared_args['
   menu_order'] = 1;`, since you can not pass this parameter on the url.
 * From my point of view it’s a bug on `wc_change_get_terms_defaults` — I’d expect
   the default sort not to be by name if the categories were manually ordered on
   the backend.
 * Other than this we found 3.6.x to be a great improvement, especially in terms
   of speed over larger data sets. Great job 👍
    -  This reply was modified 7 years, 1 month ago by [mic365](https://wordpress.org/support/users/mic365/).
    -  This reply was modified 7 years, 1 month ago by [mic365](https://wordpress.org/support/users/mic365/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Categories ordering not working on REST API on 3.6.3](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/)
 *  Thread Starter [mic365](https://wordpress.org/support/users/mic365/)
 * (@mic365)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/#post-11580524)
 * Hi Remi, do you happen to have any updates on this?
 * Thanks for the help,
    Mickey.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Categories ordering not working on REST API on 3.6.3](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/)
 *  Thread Starter [mic365](https://wordpress.org/support/users/mic365/)
 * (@mic365)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/#post-11569099)
 * Got you.
 * In our case we need the categories as were ordered via the back end so there 
   is no specific field we can supply to the `order_by`. I believe we’d need the`
   order` from `wp_termmeta`. Can that be done via the url as well?
 * Thanks for the help 👍
    Mickey.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Categories ordering not working on REST API on 3.6.3](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/)
 *  Thread Starter [mic365](https://wordpress.org/support/users/mic365/)
 * (@mic365)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/#post-11566514)
 * I’m not sure I understand you.
 * Do you mean we should add a plugin that alters `get_the_term_list` behavior? 
   Generally we prefer not to interfere with your code.
    -  This reply was modified 7 years, 2 months ago by [mic365](https://wordpress.org/support/users/mic365/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Categories ordering not working on REST API on 3.6.3](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/)
 *  Thread Starter [mic365](https://wordpress.org/support/users/mic365/)
 * (@mic365)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/categories-ordering-not-working-on-rest-api-on-3-6-2/#post-11560374)
 * I apologize for not being clear, the problem on both cases is the same and happens
   upon upgrading, hence my thought there may be a mutual cause. I’ll focus on my
   case.
 * Problem:
 * After ordering the categories on the back end, if you issue a categories request
   to the REST API, the categories are returned ordered alphabetically.
 * Way to reproduce:
    1. Install a fresh WP using wp cli.
    2. Install WC plugin using wp cli.
    3. Define several categories on the backend and order them, not in an alphabetical
       order.
    4. Issue a categories request to the REST API (e.g. [https://domain.com/wp-json/wc/v2/products/categories?consumer_key=ck_123&consumer_secret=cs_123](https://domain.com/wp-json/wc/v2/products/categories?consumer_key=ck_123&consumer_secret=cs_123))
    5. Problem: the categories are returned in an alphabetical ordered.
 * Environment:
 *     ```
       $ vagrant --version
       Vagrant 2.2.4
       $ cat Vagrantfile  | grep config.vm.box
         config.vm.box = "johannesHome/bitnami-wordpress"
   
       # inside vagrant guest os
       $ uname -a
       Linux pc-test 3.16.0-4-amd64 #1 SMP Debian 3.16.51-2 (2017-12-03) x86_64 GNU/Linux
       $ wp core version
       5.2
       $ wp plugin status woocommerce
       Plugin woocommerce details:
           Name: WooCommerce
           Status: Active
           Version: 3.6.3
           Author: Automattic
           Description: An eCommerce toolkit that helps you sell anything. Beautifully.
       ```
   
 * Thanks,
    Mickey.
    -  This reply was modified 7 years, 2 months ago by [mic365](https://wordpress.org/support/users/mic365/).
    -  This reply was modified 7 years, 2 months ago by [mic365](https://wordpress.org/support/users/mic365/).

Viewing 6 replies - 1 through 6 (of 6 total)