Quick patch : WP_User_Query orderby meta_value_num

This article is a quick patch/fix for orderby meta_value_num in WP_User_Query

When you want to sort users by their meta key there is option, but if meta value is number and you want to sort them, then there is nothing like meta_value_num in WordPress (at the time or writing (WordPress 4.1 )) for WP_User_Query. So here I have written a tiny code snippet that will be helpful.


Shyam Makwana has written 21 articles

I am PHP developer with passion of exploring IT world for new technologies. I do projects in WordPress, Joomla, Magento, Drupal, Open Cart, Code Igniter, MVC and CorePHP. Checkout my about.me profile here http://about.me/shyammakwana to know more about me.

  • Tep Afril

    Thanks! It works perfectly.