Title: Wrong sorting for ACF dropdown
Last modified: March 13, 2023

---

# Wrong sorting for ACF dropdown

 *  Resolved [MilenMK](https://wordpress.org/support/users/milenmk/)
 * (@milenmk)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/wrong-sorting-for-acf-dropdown/)
 * Hi. 
   First, I want to thank you for this plugin. I’ve decided to use it, and 
   stumbled over following issue:I’ve created filter for ACF fields as a dropdown.
   The content of the filter can be just a number, or mixed number and text (something
   like 120mm, 110.5mm, 5.2 kW). The problem was that sorting by “Termname(abc)”
   was not working correctly. I had options in this order: 10.1 kW, 11.2 kW, 12kW,
   2kW and so on.What solved my problem is changing line #969 in `src/Entities/EntityManager.
   php` from `return ($value_1 > $value_2) ? +1 : -1;` to `return strnatcmp( $value_1,
   $value_2 );`

Viewing 1 replies (of 1 total)

 *  Plugin Author [stepasyuk](https://wordpress.org/support/users/stepasyuk/)
 * (@stepasyuk)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/wrong-sorting-for-acf-dropdown/#post-16593918)
 * Hi [@milenmk](https://wordpress.org/support/users/milenmk/)
 * Thank you for using Filter Everything plugin.
 * For your purposes the best option is to use hook `'wpc_terms_before_display'`
   to sort items as you need in PHP. Please, look on this example – [https://filtereverything.pro/resources/hooks/#terms-before-display-hook](https://filtereverything.pro/resources/hooks/#terms-before-display-hook)

Viewing 1 replies (of 1 total)

The topic ‘Wrong sorting for ACF dropdown’ is closed to new replies.

 * ![](https://ps.w.org/filter-everything/assets/icon-256x256.png?rev=3487105)
 * [Filter Everything — WordPress & WooCommerce Filters](https://wordpress.org/plugins/filter-everything/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/filter-everything/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/filter-everything/)
 * [Active Topics](https://wordpress.org/support/plugin/filter-everything/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/filter-everything/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/filter-everything/reviews/)

## Tags

 * [select](https://wordpress.org/support/topic-tag/select/)
 * [sort](https://wordpress.org/support/topic-tag/sort/)

 * 1 reply
 * 2 participants
 * Last reply from: [stepasyuk](https://wordpress.org/support/users/stepasyuk/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/wrong-sorting-for-acf-dropdown/#post-16593918)
 * Status: resolved