diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index e52d6fd2f4eb..df39de1d93db 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -778,9 +778,7 @@ public function set_charset( $dbh, $charset = null, $collate = null ) { $collate = $this->collate; if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { if ( $this->use_mysqli ) { - if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) { - mysqli_set_charset( $dbh, $charset ); - } else { + if (!( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) && mysqli_set_charset( $dbh, $charset ) )) { $query = $this->prepare( 'SET NAMES %s', $charset ); if ( ! empty( $collate ) ) $query .= $this->prepare( ' COLLATE %s', $collate );