diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 9865f42be7..78dd52ced9 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -2579,8 +2579,13 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) { if ( $args['parent'] > 0 && ! term_exists( (int) $args['parent'] ) ) { return new WP_Error( 'missing_parent', __( 'Parent term does not exist.' ) ); } + $args['name'] = $term; $args['taxonomy'] = $taxonomy; + + // Coerce null description to strings, to avoid database errors. + $args['description'] = (string) $args['description']; + $args = sanitize_term($args, $taxonomy, 'db'); // expected_slashed ($name) diff --git a/wp-includes/version.php b/wp-includes/version.php index cc0ab9dc7f..37b6a01d09 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36205'; +$wp_version = '4.5-alpha-36214'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.