apply_filters( 'log_query_custom_data', array $query_data, string $query, float $query_time, string $query_callstack, float $query_start )
- Since
- 5.3.0
Filters the custom data to log alongside a query.
Description
Caution should be used when modifying any of this data, it is recommended that any additional information you need to store about a query be added as a new associative array element.
Compatibility
- WordPress
- since 5.3.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$query_dataarray- Custom query data.
$querystring- The query's SQL.
$query_timefloat- Total time spent on the query, in seconds.
$query_callstackstring- Comma-separated list of the calling functions.
$query_startfloat- Unix timestamp of the time at the start of the query.
Where this hook fires · 1
wp-includes/class-wpdb.php:2387wpdb::log_query()
Source code
<?php * @param array $query_data Custom query data. * @param string $query The query's SQL. * @param float $query_time Total time spent on the query, in seconds. * @param string $query_callstack Comma-separated list of the calling functions. * @param float $query_start Unix timestamp of the time at the start of the query. */ $query_data = apply_filters( 'log_query_custom_data', $query_data, $query, $query_time, $query_callstack, $query_start ); $this->queries[] = array( $query, $query_time, $query_callstack, $query_start,Changelog
Introduced in 5.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.