WordPress.org

Make WordPress Core

Changeset 5758


Ignore:
Timestamp:
06/25/07 21:34:06 (8 years ago)
Author:
ryan
Message:

Eliminate cat select. Use API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xmlrpc.php

    r5756 r5758  
    14801480        $categories_struct = array(); 
    14811481 
    1482         // FIXME: can we avoid using direct SQL there? 
    1483         if ($cats = $wpdb->get_results("SELECT cat_ID,cat_name,category_parent FROM $wpdb->categories", ARRAY_A)) { 
    1484             foreach ($cats as $cat) { 
    1485                 $struct['categoryId'] = $cat['cat_ID']; 
    1486                 $struct['parentId'] = $cat['category_parent']; 
    1487                 $struct['description'] = $cat['cat_name']; 
    1488                 $struct['categoryName'] = $cat['cat_name']; 
    1489                 $struct['htmlUrl'] = wp_specialchars(get_category_link($cat['cat_ID'])); 
    1490                 $struct['rssUrl'] = wp_specialchars(get_category_rss_link(false, $cat['cat_ID'], $cat['cat_name'])); 
     1482        if ( $cats = get_categories('get=all') ) { 
     1483            foreach ( $cats as $cat ) { 
     1484                $struct['categoryId'] = $cat->term_id; 
     1485                $struct['parentId'] = $cat->parent; 
     1486                $struct['description'] = $cat->name; 
     1487                $struct['categoryName'] = $cat->name; 
     1488                $struct['htmlUrl'] = wp_specialchars(get_category_link($cat->term_id)); 
     1489                $struct['rssUrl'] = wp_specialchars(get_category_rss_link(false, $cat->term_id, $cat->name)); 
    14911490 
    14921491                $categories_struct[] = $struct; 
Note: See TracChangeset for help on using the changeset viewer.