don't clobber term if sitecategories doesn't exist, fixes 13482
git-svn-id: https://develop.svn.wordpress.org/trunk@15042 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3fe2b52e01
commit
2df4a9451a
@ -1238,6 +1238,8 @@ function global_terms( $term_id, $deprecated = '' ) {
|
||||
if ( null == $used_global_id ) {
|
||||
$wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) );
|
||||
$global_id = $wpdb->insert_id;
|
||||
if ( empty( $global_id ) )
|
||||
return $term_id;
|
||||
} else {
|
||||
$max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" );
|
||||
$max_local_id = $wpdb->get_var( "SELECT MAX(term_id) FROM $wpdb->terms" );
|
||||
|
Loading…
Reference in New Issue
Block a user