show_errors ) { $this->hide_errors(); } $result = parent::query( $query ); $i = $this->num_queries - 1; if ( did_action( 'qm/cease' ) ) { // It's not possible to prevent the parent class from logging queries because it reads // the `SAVEQUERIES` constant and I don't want to override more methods than necessary. $this->queries = array(); } if ( ! isset( $this->queries[ $i ] ) ) { return $result; } $this->queries[ $i ]['trace'] = new QM_Backtrace(); if ( ! isset( $this->queries[ $i ][3] ) ) { $this->queries[ $i ][3] = $this->time_start; } if ( $this->last_error ) { $code = 'qmdb'; // This needs to remain in place to account for a user still on PHP 5. Don't want to kill their site. if ( $this->dbh instanceof mysqli ) { $code = mysqli_errno( $this->dbh ); } $this->queries[ $i ]['result'] = new WP_Error( $code, $this->last_error ); } else { $this->queries[ $i ]['result'] = $result; } return $result; } }