Make WordPress Core


Ignore:
Timestamp:
06/06/2006 05:36:28 AM (19 years ago)
Author:
ryan
Message:

Use the API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r3846 r3850  
    644644
    645645    if (!$categories)
    646         $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
     646        $categories = get_categories('hide_empty=0');
    647647
    648648    if ($categories) {
     
    686686
    687687    if (!$pages)
    688         $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY menu_order");
     688        $pages = get_pages('sort_column=menu_order');
    689689
    690690    if (! $pages)
     
    746746
    747747function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0) {
    748     global $wpdb, $bgcolor;
    749     if (!$categories) {
    750         $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
    751     }
     748    global $wpdb;
     749    if (!$categories)
     750        $categories = get_categories('hide_empty=0');
     751
    752752    if ($categories) {
    753753        foreach ($categories as $category) {
Note: See TracChangeset for help on using the changeset viewer.