Make WordPress Core

Changeset 2551


Ignore:
Timestamp:
04/19/2005 05:17:36 PM (20 years ago)
Author:
matt
Message:

More consistent use of cat_ID vs category_id

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/feed-functions.php

    r2472 r2551  
    107107}
    108108
    109 function get_category_rss_link($echo = false, $category_id, $category_nicename) {
    110        $cat_ID = $category_id;
     109function get_category_rss_link($echo = false, $cat_ID, $category_nicename) {
    111110       $permalink_structure = get_settings('permalink_structure');
    112111
  • trunk/wp-includes/functions.php

    r2550 r2551  
    592592        if ( !isset($cache_categories[$category]) ) {
    593593            $category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = $category");
    594             $category->category_id = $category->cat_ID; // Alias.
    595594            $cache_categories[$category->cat_ID] = & $category;
    596595        } else {
     
    11241123
    11251124    $dogs = $wpdb->get_results("SELECT DISTINCT
    1126     post_id, category_id FROM $wpdb->categories, $wpdb->post2cat
     1125    post_id, cat_ID FROM $wpdb->categories, $wpdb->post2cat
    11271126    WHERE category_id = cat_ID AND post_id IN ($post_ids)");
    11281127
     
    11321131    if ( !empty($dogs) ) {
    11331132        foreach ($dogs as $catt) {
    1134             $category_cache[$catt->post_id][$catt->category_id] = &$cache_categories[$catt->category_id];
     1133            $category_cache[$catt->post_id][$catt->cat_ID] = &$cache_categories[$catt->cat_ID];
    11351134        }
    11361135    }
     
    11901189function update_category_cache() {
    11911190    global $cache_categories, $wpdb;
    1192     $dogs = $wpdb->get_results("SELECT *, cat_ID as category_id FROM $wpdb->categories");
     1191    $dogs = $wpdb->get_results("SELECT * FROM $wpdb->categories");
    11931192    foreach ($dogs as $catt)
    11941193        $cache_categories[$catt->cat_ID] = $catt;
  • trunk/wp-includes/template-functions-category.php

    r2478 r2551  
    5757                        $thelist .= get_category_parents($category->category_parent, TRUE);
    5858                    }
    59                     $thelist .= '<a href="' . get_category_link($category->category_id) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>';
     59                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>';
    6060                    break;
    6161                case 'single':
    62                     $thelist .= '<a href="' . get_category_link($category->category_id) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . ' rel="category tag">';
     62                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . ' rel="category tag">';
    6363                    if ($category->category_parent) {
    6464                        $thelist .= get_category_parents($category->category_parent, FALSE);
     
    6868                case '':
    6969                default:
    70                     $thelist .= '<a href="' . get_category_link($category->category_id) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>';
     70                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a></li>';
    7171            }
    7272        }
     
    8080                case 'multiple':
    8181                    if ($category->category_parent)    $thelist .= get_category_parents($category->category_parent, TRUE);
    82                     $thelist .= '<a href="' . get_category_link($category->category_id) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>';
     82                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>';
    8383                    break;
    8484                case 'single':
    85                     $thelist .= '<a href="' . get_category_link($category->category_id) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">';
     85                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">';
    8686                    if ($category->category_parent)    $thelist .= get_category_parents($category->category_parent, FALSE);
    8787                    $thelist .= "$category->cat_name</a>";
     
    8989                case '':
    9090                default:
    91                     $thelist .= '<a href="' . get_category_link($category->category_id) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>';
     91                    $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '" rel="category tag">'.$category->cat_name.'</a>';
    9292            }
    9393            ++$i;
     
    140140    // Grab the first cat in the list.
    141141    $categories = get_the_category();
    142     $cat = $categories[0]->category_id;
     142    $cat = $categories[0]->cat_ID;
    143143   
    144144    if ($echo) echo $cat;
     
    289289   
    290290    if ( $optiondates ) {
    291         $cat_dates = $wpdb->get_results("   SELECT category_id,
     291        $cat_dates = $wpdb->get_results("   SELECT cat_ID,
    292292        UNIX_TIMESTAMP( MAX(post_date) ) AS ts
    293293        FROM $wpdb->posts, $wpdb->post2cat
     
    295295        GROUP BY category_id");
    296296        foreach ($cat_dates as $cat_date) {
    297             $category_timestamp["$cat_date->category_id"] = $cat_date->ts;
     297            $category_timestamp["$cat_date->cat_ID"] = $cat_date->ts;
    298298        }
    299299    }
     
    387387    $cats = '';
    388388    foreach ($category_cache[$post->ID] as $cat) :
    389         $cats[] = $cat->category_id;
     389        $cats[] = $cat->cat_ID;
    390390    endforeach;
    391391
Note: See TracChangeset for help on using the changeset viewer.