WordPress Version: 6.1
/*
* Comments loop.
*/
/**
* Determines whether current WordPress query has comments to loop over.
*
* @since 2.2.0
*
* @global WP_Query $wp_query WordPress Query object.
*
* @return bool True if comments are available, false if no more comments.
*/
function have_comments()
{
global $wp_query;
if (!isset($wp_query)) {
return false;
}
return $wp_query->have_comments();
}