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:
parent
6030d299e9
commit
3d7bc44610
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user