Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Created October 31, 2016 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellofromtonya/333c14e543d6d6f1d4363d16ab9cfcd5 to your computer and use it in GitHub Desktop.
Save hellofromtonya/333c14e543d6d6f1d4363d16ab9cfcd5 to your computer and use it in GitHub Desktop.
Add this code to the WordPress wpdb::get_results method.
<?php
/**
* Add the following testing code into the `wp-includes/wp-db.php` file
* This snippet of code will trigger our plugin's recorder.
*/
public function get_results( $query = null, $output = OBJECT ) {
// TESTING - TONYA
if ( function_exists( 'UpTechLabs\KnowTheCode\GroupbyLab\record_database_hit' ) ) {
\UpTechLabs\KnowTheCode\GroupbyLab\record_database_hit( $query );
}
// TESTING-END - TONYA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment