diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 12864b343a..9f84855257 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -2276,7 +2276,11 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { 'term_taxonomy_id' => $tt_id, ); } - $wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ) + array( 'count' => 0 ) ); + + if ( false === $wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy', 'description', 'parent' ) + array( 'count' => 0 ) ) ) { + return new WP_Error( 'db_insert_error', __( 'Could not insert term taxonomy into the database.' ), $wpdb->last_error ); + } + $tt_id = (int) $wpdb->insert_id; /* diff --git a/wp-includes/version.php b/wp-includes/version.php index b6bc689089..fbf79765e9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45357'; +$wp_version = '5.3-alpha-45362'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.