diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index ebcadb6ef0..80c117c1a0 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -1915,6 +1915,11 @@ class wpdb { */ $query = apply_filters( 'query', $query ); + if ( ! $query ) { + $this->insert_id = 0; + return false; + } + $this->flush(); // Log how the function was called.