Make WordPress Core


Ignore:
Timestamp:
06/06/2006 05:04:41 AM (20 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-db.php

    r3845 r3849  
    188188        $posts = $wpdb->get_col("SELECT post_id FROM $wpdb->post2cat WHERE category_id='$cat_ID'");
    189189        if ( is_array($posts) ) foreach ($posts as $post_id) {
    190                 $cats = wp_get_post_cats('', $post_id);
     190                $cats = wp_get_post_categories($post_id);
    191191                if ( 1 == count($cats) )
    192192                        $cats = array($default_cat);
    193193                else
    194194                        $cats = array_diff($cats, array($cat_ID));
    195                 wp_set_post_cats('', $post_id, $cats);
     195                wp_set_post_categories($post_id, $cats);
    196196        }
    197197
     
    231231
    232232        if ($post_id)
    233                 wp_set_post_cats('', $post_id, $cat_ids);
     233                wp_set_post_categories($post_id, $cat_ids);
    234234
    235235        return $cat_ids;
Note: See TracChangeset for help on using the changeset viewer.