mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 14:35:07 +00:00
don't clobber term if sitecategories doesn't exist, fixes 13482
git-svn-id: http://svn.automattic.com/wordpress/trunk@15042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e9a102d83a
commit
daba4756cc
@ -1238,6 +1238,8 @@ function global_terms( $term_id, $deprecated = '' ) {
|
|||||||
if ( null == $used_global_id ) {
|
if ( null == $used_global_id ) {
|
||||||
$wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) );
|
$wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug ) );
|
||||||
$global_id = $wpdb->insert_id;
|
$global_id = $wpdb->insert_id;
|
||||||
|
if ( empty( $global_id ) )
|
||||||
|
return $term_id;
|
||||||
} else {
|
} else {
|
||||||
$max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" );
|
$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" );
|
$max_local_id = $wpdb->get_var( "SELECT MAX(term_id) FROM $wpdb->terms" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user