Use category_exists instead of a direct query.

git-svn-id: https://develop.svn.wordpress.org/trunk@5162 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2007-03-31 22:38:51 +00:00
parent 6030d299e9
commit 3d7bc44610

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) {