From 7337c5bbc06944f9a5bb243101b42cd789c41ff0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 11 Jul 2006 18:01:53 +0000 Subject: [PATCH] Allow ordering by count. git-svn-id: https://develop.svn.wordpress.org/trunk@4014 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/category.php b/wp-includes/category.php index 8c73e6c1f9..2a00ed3a0e 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -22,7 +22,10 @@ function &get_categories($args = '') { $defaults = array('type' => 'post', 'child_of' => 0, 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, 'include_last_update_time' => false, 'hierarchical' => 1, $exclude => '', $include => ''); $r = array_merge($defaults, $r); - $r['orderby'] = "cat_" . $r['orderby']; // restricts order by to cat_ID and cat_name fields + if ( 'count' == $r['orderby'] ) + $r['orderby'] = 'category_count'; + else + $r['orderby'] = "cat_" . $r['orderby']; // restricts order by to cat_ID and cat_name fields extract($r); $where = 'cat_ID > 0';