Deprecate wp_get/set_post_cats() in favor of wp_get/set_post_categories().

git-svn-id: https://develop.svn.wordpress.org/trunk@3849 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-06-06 05:04:41 +00:00
parent 54a665ff4d
commit 53d59dd1f0
4 changed files with 26 additions and 18 deletions

View File

@@ -187,12 +187,12 @@ function wp_delete_category($cat_ID) {
$default_cat = get_option('default_category');
$posts = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id='$cat_ID'");
if ( is_array($posts) ) foreach ($posts as $post_id) {
$cats = wp_get_post_cats('', $post_id);
$cats = wp_get_post_categories($post_id);
if ( 1 == count($cats) )
$cats = array($default_cat);
else
$cats = array_diff($cats, array($cat_ID));
wp_set_post_cats('', $post_id, $cats);
wp_set_post_categories($post_id, $cats);
}
$default_link_cat = get_option('default_link_category');
@@ -230,7 +230,7 @@ function wp_create_categories($categories, $post_id = '') {
}
if ($post_id)
wp_set_post_cats('', $post_id, $cat_ids);
wp_set_post_categories($post_id, $cat_ids);
return $cat_ids;
}