From 741934931d13a62e0d4da57d188963bfd495bdbf Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 6 Jun 2006 05:36:28 +0000 Subject: [PATCH] Use the API. git-svn-id: http://svn.automattic.com/wordpress/trunk@3850 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 1ee9c02b2..9f596fc7d 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -643,7 +643,7 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) { global $wpdb, $class; if (!$categories) - $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name"); + $categories = get_categories('hide_empty=0'); if ($categories) { foreach ($categories as $category) { @@ -685,7 +685,7 @@ function page_rows($parent = 0, $level = 0, $pages = 0, $hierarchy = true) { global $wpdb, $class, $post; if (!$pages) - $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY menu_order"); + $pages = get_pages('sort_column=menu_order'); if (! $pages) return false; @@ -745,10 +745,10 @@ function user_row( $user_object, $style = '' ) { } function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0) { - global $wpdb, $bgcolor; - if (!$categories) { - $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name"); - } + global $wpdb; + if (!$categories) + $categories = get_categories('hide_empty=0'); + if ($categories) { foreach ($categories as $category) { if ($currentcat != $category->cat_ID && $parent == $category->category_parent) {