get_terms() not order tags by count

I need to return the 10 most used tags. So I do that:

$args = array(
‘taxonomy’ => ‘post_tag’,
‘orderby’ => ‘count’,
‘order’ => ‘DESC’,
‘number’ => 10
);

$tags = get_terms($args);

But the order is not correct. The first tag in the list is not the most used.

Read more here:: get_terms() not order tags by count

Leave a Reply

Your email address will not be published. Required fields are marked *