Changeset 4606
- Timestamp:
- 12/05/2006 06:45:48 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r4601 r4606 430 430 } 431 431 432 function wp_get_post_categories($post_ID = 0) { 433 global $wpdb; 434 435 $post_ID = (int) $post_ID; 436 437 $sql = "SELECT category_id 438 FROM $wpdb->post2cat 439 WHERE post_id = '$post_ID' 440 ORDER BY category_id"; 441 442 $result = $wpdb->get_col($sql); 443 444 if ( !$result ) 445 $result = array(); 446 447 return array_unique($result); 432 function wp_get_post_categories($post_id = 0) { 433 $cats = &get_the_category($post_id); 434 $cat_ids = array(); 435 foreach ( $cats as $cat ) 436 $cat_ids[] = (int) $cat->cat_ID; 437 return array_unique($cat_ids); 448 438 } 449 439
Note: See TracChangeset
for help on using the changeset viewer.