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 insrc/Entities/EntityManager.php
fromreturn ($value_1 > $value_2) ? +1 : -1;
toreturn strnatcmp( $value_1, $value_2 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Wrong sorting for ACF dropdown’ is closed to new replies.