get_num_queries
Retrieve the number of database queries during the WordPress execution.
Description
(int) get_num_queries();
Returns (int)
Number of database queries.
Usage
if ( !function_exists( 'get_num_queries' ) ) { require_once ABSPATH . WPINC . '/functions.php'; } // NOTICE! Understand what this does before running. $result = get_num_queries();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/functions.php
- function get_num_queries() {
- global $wpdb;
- return $wpdb->num_queries;
- }