Make WordPress Core


Ignore:
Timestamp:
06/04/2006 09:36:52 PM (19 years ago)
Author:
ryan
Message:

Reorg category functions. #2525

File:
1 edited

Legend:

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

    r3788 r3843  
    608608}
    609609
    610 // Get the name of a category from its ID
    611 function get_cat_name($cat_id) {
    612     global $wpdb;
    613 
    614     $cat_id -= 0;   // force numeric
    615     $name = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE cat_ID=$cat_id");
    616 
    617     return $name;
    618 }
    619 
    620 // Get the ID of a category from its name
    621 function get_cat_ID($cat_name='General') {
    622     global $wpdb;
    623 
    624     $cid = $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE cat_name='$cat_name'");
    625 
    626     return $cid?$cid:1; // default to cat 1
    627 }
    628 
    629610// Get author's preferred display name
    630611function get_author_name( $auth_id ) {
Note: See TracChangeset for help on using the changeset viewer.