diff --git wp-includes/wp-db.php wp-includes/wp-db.php
index f1fd1c297f..751809cbca 100644
|
|
class wpdb { |
2014 | 2014 | $this->num_queries++; |
2015 | 2015 | |
2016 | 2016 | if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { |
2017 | | $this->queries[] = array( |
2018 | | $query, |
2019 | | $this->timer_stop(), |
2020 | | $this->get_caller(), |
2021 | | $this->time_start, |
| 2017 | /** |
| 2018 | * Filters the empty query data parameter to allow custom data to be added. |
| 2019 | * All values added to this array should be in the form of associative |
| 2020 | * array elements. |
| 2021 | * |
| 2022 | * @since 5.3.0 |
| 2023 | * |
| 2024 | * @param array Custom data associated with the currently run query. |
| 2025 | */ |
| 2026 | $this->log_query( |
| 2027 | array( |
| 2028 | $query, |
| 2029 | $this->timer_stop(), |
| 2030 | $this->get_caller(), |
| 2031 | apply_filters( 'savequeries_add_querydata', array() ), |
| 2032 | ) |
2022 | 2033 | ); |
2023 | 2034 | } |
2024 | 2035 | } |
2025 | 2036 | |
| 2037 | /** |
| 2038 | * Logs query data. |
| 2039 | * |
| 2040 | * @since 5.3.0 |
| 2041 | * |
| 2042 | * @param array $query_data The query data to run. Expects |
| 2043 | * query, query elapsed time, callback, associative array |
| 2044 | * of misc data. |
| 2045 | */ |
| 2046 | public function log_query( $query_data ) { |
| 2047 | $this->queries[] = $query_data; |
| 2048 | } |
| 2049 | |
2026 | 2050 | /** |
2027 | 2051 | * Generates and returns a placeholder escape string for use in queries returned by ::prepare(). |
2028 | 2052 | * |