Use _wp_tag_cloud_count_sort_cb instead of an anonymous function. Props ocean90. see #14424
git-svn-id: https://develop.svn.wordpress.org/trunk@18814 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
03375fa844
commit
9ad9ff1282
@ -642,9 +642,9 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
|||||||
} else {
|
} else {
|
||||||
// SQL cannot save you; this is a second (potentially different) sort on a subset of data.
|
// SQL cannot save you; this is a second (potentially different) sort on a subset of data.
|
||||||
if ( 'name' == $orderby )
|
if ( 'name' == $orderby )
|
||||||
uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') );
|
uasort( $tags, '_wp_tag_cloud_name_sort_cb' );
|
||||||
else
|
else
|
||||||
uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
|
uasort( $tags, '_wp_tag_cloud_count_sort_cb' );
|
||||||
|
|
||||||
if ( 'DESC' == $order )
|
if ( 'DESC' == $order )
|
||||||
$tags = array_reverse( $tags, true );
|
$tags = array_reverse( $tags, true );
|
||||||
|
Loading…
Reference in New Issue
Block a user