Sorting URL columns – Problem and Solution
-
URL columns have problems with sorting. If data is a simple url it is sorted alphabetically wich is correct. If data is formatted as url||DisplayText it is sorted by the whole string and not by DisplayText only. In most cases the column will be sorted on url. This makes sorting on this column type confusing for the end user.
I have been diving into the code and found a solution that solves my problem but I admit that I have not tested it with html code in DisplayText.
In the file plugins\wpdatatables\source\class.link.wpdatacolumn.php
change
protected $_jsDataType = 'string';
to
protected $_jsDataType = 'html';
Please consider to make this change in the code either permanently or as a configurable option.
- The topic ‘Sorting URL columns – Problem and Solution’ is closed to new replies.