M
M
Mixa2018-03-10 18:45:15
WordPress
Mixa, 2018-03-10 18:45:15

How to sort numbers correctly in WP_List_Table{}?

I created a page in the admin panel, on which certain data is displayed in the form of a table. To build a table, I use the WP_List_Table{} class. When I try to enable sorting of numbers, I get the following picture:
5aa3fd49a478e687937425.jpeg
I.e. only the first digit of the number is taken first, and not the entire number. How to make it sort correctly?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Myakish999, 2020-05-06
@Myakish999

Maybe because the data is not numbers, but strings?
In php, you can explicitly convert a string to a number by multiplying by 1.

3
3vi1_0n3, 2013-08-25
@ixSci

The new Zyxel Keenetic Giga II does a better job, here's a proof , for example.

Y
Yaroslav, 2013-08-25
@frantic

I have ASUS RT-N66U (http://market.yandex.ru/model.xml?modelid=7857439&hid=723087).
Connected via L2TP. Torrents download at 9.7 MB/s. And both on the lan and on wifi. At the same time, a gigabit lan network of 5 computers works without brakes. At this time, you can watch movies from a local server, sit on the net, play old man or Dota 2 and no one will notice the brakes.
Works for over a year. I advise.

A
Anastasia_K, 2013-08-25
@Anastasia_K

disable hardware NAT and auto QoS. I also suffered until Zyxel support advised me to do this. It got much better. And yes, as already advised above, keenetic giga II copes better with loads.

S
Sergey Cherepanov, 2013-08-25
@fear86

100 still won't happen, since this is a tunnel, you need to add service packets to the traffic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question