Changeset 3849
- Timestamp:
- 06/06/2006 05:04:41 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-db.php
r3845 r3849 188 188 $posts = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id='$cat_ID'"); 189 189 if ( is_array($posts) ) foreach ($posts as $post_id) { 190 $cats = wp_get_post_cat s('',$post_id);190 $cats = wp_get_post_categories($post_id); 191 191 if ( 1 == count($cats) ) 192 192 $cats = array($default_cat); 193 193 else 194 194 $cats = array_diff($cats, array($cat_ID)); 195 wp_set_post_cat s('',$post_id, $cats);195 wp_set_post_categories($post_id, $cats); 196 196 } 197 197 … … 231 231 232 232 if ($post_id) 233 wp_set_post_cat s('',$post_id, $cat_ids);233 wp_set_post_categories($post_id, $cat_ids); 234 234 235 235 return $cat_ids; -
trunk/wp-includes/deprecated.php
r3848 r3849 463 463 } 464 464 465 function wp_get_post_cats($blogid = '1', $post_ID = 0) { 466 return wp_get_post_categories($post_ID); 467 } 468 469 function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { 470 return wp_set_post_categories($post_ID, $post_categories); 471 } 472 465 473 ?> -
trunk/wp-includes/functions-post.php
r3843 r3849 162 162 } 163 163 164 wp_set_post_cat s('',$post_ID, $post_category);164 wp_set_post_categories($post_ID, $post_category); 165 165 166 166 if ( 'page' == $post_type ) { … … 349 349 } 350 350 351 wp_set_post_cat s('',$post_ID, $post_category);351 wp_set_post_categories($post_ID, $post_category); 352 352 353 353 if ( $file ) … … 412 412 // Set categories 413 413 if($mode == OBJECT) { 414 $post->post_category = wp_get_post_cat s('',$postid);414 $post->post_category = wp_get_post_categories($postid); 415 415 } 416 416 else { 417 $post['post_category'] = wp_get_post_cat s('',$postid);417 $post['post_category'] = wp_get_post_categories($postid); 418 418 } 419 419 … … 487 487 } 488 488 489 function wp_get_post_cat s($blogid = '1',$post_ID = 0) {489 function wp_get_post_categories($post_ID = 0) { 490 490 global $wpdb; 491 491 … … 505 505 } 506 506 507 function wp_set_post_cat s($blogid = '1',$post_ID = 0, $post_categories = array()) {507 function wp_set_post_categories($post_ID = 0, $post_categories = array()) { 508 508 global $wpdb; 509 509 // If $post_categories isn't already an array, make it one: … … 556 556 wp_cache_delete($cat_id, 'category'); 557 557 } 558 } // wp_set_post_cat s()558 } // wp_set_post_categories() 559 559 560 560 function wp_delete_post($postid = 0) { … … 571 571 572 572 if ( 'publish' == $post->post_status && 'post' == $post->post_type ) { 573 $categories = wp_get_post_cat s('',$post->ID);573 $categories = wp_get_post_categories($post->ID); 574 574 if( is_array( $categories ) ) { 575 575 foreach ( $categories as $cat_id ) { -
trunk/xmlrpc.php
r3517 r3849 243 243 $post_data = wp_get_single_post($post_ID, ARRAY_A); 244 244 245 $categories = implode(',', wp_get_post_cat s(1,$post_ID));245 $categories = implode(',', wp_get_post_categories($post_ID)); 246 246 247 247 $content = '<title>'.stripslashes($post_data['post_title']).'</title>'; … … 286 286 287 287 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); 288 $categories = implode(',', wp_get_post_cat s(1,$entry['ID']));288 $categories = implode(',', wp_get_post_categories($entry['ID'])); 289 289 290 290 $content = '<title>'.stripslashes($entry['post_title']).'</title>'; … … 696 696 697 697 $categories = array(); 698 $catids = wp_get_post_cat s('',$post_ID);698 $catids = wp_get_post_categories($post_ID); 699 699 foreach($catids as $catid) { 700 700 $categories[] = get_cat_name($catid); … … 756 756 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); 757 757 $categories = array(); 758 $catids = wp_get_post_cat s('',$entry['ID']);758 $catids = wp_get_post_categories($entry['ID']); 759 759 foreach($catids as $catid) { 760 760 $categories[] = get_cat_name($catid); … … 959 959 960 960 $categories = array(); 961 $catids = wp_get_post_cat s('',intval($post_ID));961 $catids = wp_get_post_categories(intval($post_ID)); 962 962 // first listed category will be the primary category 963 963 $isPrimary = true; … … 997 997 } 998 998 999 wp_set_post_cat s('',$post_ID, $catids);999 wp_set_post_categories($post_ID, $catids); 1000 1000 1001 1001 return true; … … 1080 1080 1081 1081 // retain old cats 1082 $cats = wp_get_post_cat s('',$post_ID);1082 $cats = wp_get_post_categories($post_ID); 1083 1083 $postdata['post_category'] = $cats; 1084 1084 $this->escape($postdata);
Note: See TracChangeset
for help on using the changeset viewer.