Make WordPress Core

Ticket #42151: 42151.5.diff

File 42151.5.diff, 1.2 KB (added by CrazyJaco, 6 years ago)

Refreshed Patch for WordPress 5.3

  • wp-includes/wp-db.php

    diff --git wp-includes/wp-db.php wp-includes/wp-db.php
    index f1fd1c297f..751809cbca 100644
    class wpdb { 
    20142014                $this->num_queries++;
    20152015
    20162016                if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) {
    2017                         $this->queries[] = array(
    2018                                 $query,
    2019                                 $this->timer_stop(),
    2020                                 $this->get_caller(),
    2021                                 $this->time_start,
     2017                        /**
     2018                         * Filters the empty query data parameter to allow custom data to be added.
     2019                         * All values added to this array should be in the form of associative
     2020                         * array elements.
     2021                         *
     2022                         * @since 5.3.0
     2023                         *
     2024                         * @param array  Custom data associated with the currently run query.
     2025                         */
     2026                        $this->log_query(
     2027                                array(
     2028                                        $query,
     2029                                        $this->timer_stop(),
     2030                                        $this->get_caller(),
     2031                                        apply_filters( 'savequeries_add_querydata', array() ),
     2032                                )
    20222033                        );
    20232034                }
    20242035        }
    20252036
     2037        /**
     2038         * Logs query data.
     2039         *
     2040         * @since 5.3.0
     2041         *
     2042         * @param array $query_data The query data to run. Expects
     2043         *  query, query elapsed time, callback, associative array
     2044         *  of misc data.
     2045         */
     2046        public function log_query( $query_data ) {
     2047                $this->queries[] = $query_data;
     2048        }
     2049
    20262050        /**
    20272051         * Generates and returns a placeholder escape string for use in queries returned by ::prepare().
    20282052         *