Changeset 3843 for trunk/wp-includes/functions-post.php
- Timestamp:
- 06/04/2006 09:36:52 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-post.php
r3788 r3843 608 608 } 609 609 610 // Get the name of a category from its ID611 function get_cat_name($cat_id) {612 global $wpdb;613 614 $cat_id -= 0; // force numeric615 $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 name621 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 1627 }628 629 610 // Get author's preferred display name 630 611 function get_author_name( $auth_id ) {
Note: See TracChangeset
for help on using the changeset viewer.