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:
parent
64771eb61d
commit
3bf8b1699a
|
@ -122,7 +122,7 @@ function wp_insert_category($catarr) {
|
||||||
$links_private = 0;
|
$links_private = 0;
|
||||||
|
|
||||||
// Let's check if we have this category already, if so just do an update
|
// 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;
|
$update = true;
|
||||||
|
|
||||||
if (!$update) {
|
if (!$update) {
|
||||||
|
|
Loading…
Reference in New Issue