diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php index b70cae2e4..5e16fe777 100644 --- a/wp-admin/admin-db.php +++ b/wp-admin/admin-db.php @@ -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; } diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 9b34885ca..a7a3044f4 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -462,4 +462,12 @@ function list_authors($optioncount = false, $exclude_admin = true, $show_fullnam return wp_list_authors($args); } +function wp_get_post_cats($blogid = '1', $post_ID = 0) { + return wp_get_post_categories($post_ID); +} + +function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { + return wp_set_post_categories($post_ID, $post_categories); +} + ?> diff --git a/wp-includes/functions-post.php b/wp-includes/functions-post.php index 0d18e5262..7c2e497de 100644 --- a/wp-includes/functions-post.php +++ b/wp-includes/functions-post.php @@ -161,7 +161,7 @@ function wp_insert_post($postarr = array()) { $wpdb->query( "UPDATE $wpdb->posts SET post_name = '$post_name' WHERE ID = '$post_ID'" ); } - wp_set_post_cats('', $post_ID, $post_category); + wp_set_post_categories($post_ID, $post_category); if ( 'page' == $post_type ) { clean_page_cache($post_ID); @@ -348,7 +348,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) { $wpdb->query( "UPDATE $wpdb->posts SET post_name = '$post_name' WHERE ID = '$post_ID'" ); } - wp_set_post_cats('', $post_ID, $post_category); + wp_set_post_categories($post_ID, $post_category); if ( $file ) add_post_meta($post_ID, '_wp_attached_file', $file ); @@ -411,10 +411,10 @@ function wp_get_single_post($postid = 0, $mode = OBJECT) { // Set categories if($mode == OBJECT) { - $post->post_category = wp_get_post_cats('',$postid); + $post->post_category = wp_get_post_categories($postid); } else { - $post['post_category'] = wp_get_post_cats('',$postid); + $post['post_category'] = wp_get_post_categories($postid); } return $post; @@ -486,7 +486,7 @@ function wp_publish_post($post_id) { return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id)); } -function wp_get_post_cats($blogid = '1', $post_ID = 0) { +function wp_get_post_categories($post_ID = 0) { global $wpdb; $post_ID = (int) $post_ID; @@ -504,7 +504,7 @@ function wp_get_post_cats($blogid = '1', $post_ID = 0) { return array_unique($result); } -function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { +function wp_set_post_categories($post_ID = 0, $post_categories = array()) { global $wpdb; // If $post_categories isn't already an array, make it one: if (!is_array($post_categories) || 0 == count($post_categories)) @@ -555,7 +555,7 @@ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array( $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'"); wp_cache_delete($cat_id, 'category'); } -} // wp_set_post_cats() +} // wp_set_post_categories() function wp_delete_post($postid = 0) { global $wpdb, $wp_rewrite; @@ -570,7 +570,7 @@ function wp_delete_post($postid = 0) { do_action('delete_post', $postid); if ( 'publish' == $post->post_status && 'post' == $post->post_type ) { - $categories = wp_get_post_cats('', $post->ID); + $categories = wp_get_post_categories($post->ID); if( is_array( $categories ) ) { foreach ( $categories as $cat_id ) { $wpdb->query("UPDATE $wpdb->categories SET category_count = category_count - 1 WHERE cat_ID = '$cat_id'"); diff --git a/xmlrpc.php b/xmlrpc.php index aa1c520ea..0b7e1a4e7 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -242,7 +242,7 @@ class wp_xmlrpc_server extends IXR_Server { $user_data = get_userdatabylogin($user_login); $post_data = wp_get_single_post($post_ID, ARRAY_A); - $categories = implode(',', wp_get_post_cats(1, $post_ID)); + $categories = implode(',', wp_get_post_categories($post_ID)); $content = '