From 5ce03d44bb1a97e51a2a0833246797f6a4a7f91a Mon Sep 17 00:00:00 2001 From: markjaquith Date: Sun, 10 Dec 2006 20:27:20 +0000 Subject: [PATCH] cat_id_filter from Donncha. fixes #3458 git-svn-id: http://svn.automattic.com/wordpress/trunk@4638 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-db.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php index 882d50c719..c53d5562c8 100644 --- a/wp-admin/admin-db.php +++ b/wp-admin/admin-db.php @@ -133,6 +133,11 @@ function wp_insert_category($catarr) { $wpdb->query( "UPDATE $wpdb->categories SET category_nicename = '$category_nicename' WHERE cat_ID = '$cat_ID'" ); } + // Keep in mind when using this filter and altering the cat_ID that the two queries above + // have already taken place with the OLD cat_ID + // Also note that you may have post2cat entries with the old cat_ID if this is an update + $cat_ID = apply_filters('cat_id_filter', $cat_ID, $update); + clean_category_cache($cat_ID); if ($update) {