Skip to content

Commit

Permalink
add filter to disable query logging
Browse files Browse the repository at this point in the history
addresses 10up#4006
  • Loading branch information
davidsword authored Nov 14, 2024
1 parent 72e9dc0 commit f11ffc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/classes/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,8 @@ public function add_elasticpress_version_to_user_agent( $user_agent ) {
* @param array $query Query to log.
*/
protected function add_query_log( $query ) {
if ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || ( defined( 'WP_EP_DEBUG' ) && WP_EP_DEBUG ) ) {
$disable_logging = apply_filters( 'ep_disable_query_logging', false );
if ( ! $disable_logging && ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || ( defined( 'WP_EP_DEBUG' ) && WP_EP_DEBUG ) ) ) {
$this->queries[] = $query;
}

Expand Down

0 comments on commit f11ffc3

Please sign in to comment.