Use category_exists instead of a direct query.

git-svn-id: http://svn.automattic.com/wordpress/trunk@5162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2007-03-31 22:38:51 +00:00
parent 64771eb61d
commit 3bf8b1699a
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ function wp_insert_category($catarr) {
$links_private = 0;
// Let's check if we have this category already, if so just do an update
if ( $cat_ID = $wpdb->get_var( "SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename' " ) )
if ( $cat_ID = category_exists( $category_nicename ) )
$update = true;
if (!$update) {