diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php
index f1fd1c297f..6d1c45ba97 100644
a
|
b
|
class wpdb { |
180 | 180 | * @since 1.5.0 |
181 | 181 | * @since 2.5.0 The third element in each query log was added to record the calling functions. |
182 | 182 | * @since 5.1.0 The fourth element in each query log was added to record the start time. |
| 183 | * @since 5.3.0 The fifth element in each query log was added to record custom data. |
183 | 184 | * |
184 | 185 | * @var array[] { |
185 | 186 | * Array of queries that were executed. |
… |
… |
class wpdb { |
191 | 192 | * @type float $1 Total time spent on the query, in seconds. |
192 | 193 | * @type string $2 Comma separated list of the calling functions. |
193 | 194 | * @type float $3 Unix timestamp of the time at the start of the query. |
| 195 | * @type array $4 Custom query data added with the `savequeries_add_querydata` filter. |
194 | 196 | * } |
195 | 197 | * } |
196 | 198 | */ |
… |
… |
class wpdb { |
2014 | 2016 | $this->num_queries++; |
2015 | 2017 | |
2016 | 2018 | if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { |
2017 | | $this->queries[] = array( |
2018 | | $query, |
2019 | | $this->timer_stop(), |
2020 | | $this->get_caller(), |
2021 | | $this->time_start, |
| 2019 | $this->log_query( |
| 2020 | array( |
| 2021 | $query, |
| 2022 | $this->timer_stop(), |
| 2023 | $this->get_caller(), |
| 2024 | array(), |
| 2025 | ) |
2022 | 2026 | ); |
2023 | 2027 | } |
2024 | 2028 | } |
2025 | 2029 | |
| 2030 | /** |
| 2031 | * Logs query data. |
| 2032 | * |
| 2033 | * @since 5.3.0 |
| 2034 | * |
| 2035 | * @param array $query_data { |
| 2036 | * Array of queries that were executed. |
| 2037 | * |
| 2038 | * @type array ...$0 { |
| 2039 | * Data for each query. |
| 2040 | * |
| 2041 | * @type string $0 The query's SQL. |
| 2042 | * @type float $1 Total time spent on the query, in seconds. |
| 2043 | * @type string $2 Comma separated list of the calling functions. |
| 2044 | * @type float $3 Unix timestamp of the time at the start of the query. |
| 2045 | * @type array $4 Custom query data added with the `savequeries_add_querydata` filter. |
| 2046 | * } |
| 2047 | * } |
| 2048 | */ |
| 2049 | public function log_query( $query_data ) { |
| 2050 | /** |
| 2051 | * Filters the query data being logged. |
| 2052 | * |
| 2053 | * @since 5.3.0 |
| 2054 | * |
| 2055 | * @param array $query_data { |
| 2056 | * Array of queries that were executed. |
| 2057 | * |
| 2058 | * @type array ...$0 { |
| 2059 | * Data for each query. |
| 2060 | * |
| 2061 | * @type string $0 The query's SQL. |
| 2062 | * @type float $1 Total time spent on the query, in seconds. |
| 2063 | * @type string $2 Comma separated list of the calling functions. |
| 2064 | * @type float $3 Unix timestamp of the time at the start of the query. |
| 2065 | * @type array $4 Custom query data added with the `savequeries_add_querydata` filter. |
| 2066 | * } |
| 2067 | * } |
| 2068 | */ |
| 2069 | $this->queries[] = apply_filters( 'log_query_data', $query_data ); |
| 2070 | } |
| 2071 | |
2026 | 2072 | /** |
2027 | 2073 | * Generates and returns a placeholder escape string for use in queries returned by ::prepare(). |
2028 | 2074 | * |