This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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']; | |
} |