Fixed error when no SQL queries logged by core.
This commit is contained in:
1 parent
fcf17e44d4
commit
7d64b920eb
2 files changed
+6
-3
No files matched your search
@@ -56,12 +56,12 @@ class Sql_Record_Collector implements Record_Collector_Interface {
|
||||
*/
|
||||
public function get_records(): array {
|
||||
|
||||
if ( ! $this->is_savequeries() ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( empty( $wpdb->queries ) ) {
|
||||
return [];
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
|
||||
/** @var array $wpdb->queries */
|
||||
return array_map( [ $this, 'transform' ], array_keys( $wpdb->queries ), $wpdb->queries );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user