函数原型
have_posts(): bool
函数描述
Determines whether current WordPress query has posts to loop over.
是否弃用
未弃用
函数参数
无
函数返回值
bool True if posts are available, false if end of the loop.
函数位置
File: wp-includes/query.php.
函数源码
function have_posts() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
return false;
}
return $wp_query->have_posts();
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

