get_num_queries() WordPress Function
The get_num_queries() function is a built-in WordPress function that allows you to get the number of database queries that have been executed on a WordPress page. This function is useful for debugging purposes, as it can help you identify areas of your code that are making excessive database queries.
get_num_queries() #
Retrieve the number of database queries during the WordPress execution.
Return
(int) Number of database queries.
Source
File: wp-includes/functions.php
function get_num_queries() {
global $wpdb;
return $wpdb->num_queries;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |