diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 4014a62655..531a6f537b 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -1480,6 +1480,10 @@ function unregister_term_meta( $taxonomy, $meta_key ) { function term_exists( $term, $taxonomy = '', $parent = null ) { global $wpdb; + if ( null === $term ) { + return null; + } + $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; diff --git a/wp-includes/version.php b/wp-includes/version.php index b97456cec8..1633986cd2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51795'; +$wp_version = '5.9-alpha-51796'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.