Skip to content

Instantly share code, notes, and snippets.

View Ezyweb-uk's full-sized avatar

Nick Woolley Ezyweb-uk

View GitHub Profile
@j3j5
j3j5 / functions.php
Created August 28, 2017 18:23
Log all SQL queries made from Wordpress
<?php
// Include this on your functions.php
function log_sql_queries($text_query){
/* //Uncomment me if you want a lot of info about where the sql query comes from and what action started it off
$traces = debug_backtrace();
foreach ($traces as $tobj => $trace) {
if($trace['function'] == 'do_action'){
$args = $trace['args'];
}