函数原型
in_the_loop(): bool
函数描述
Determines whether the caller is in the Loop.
是否弃用
未弃用
函数参数
无
函数返回值
bool True if caller is within loop, false if loop hasn’t started or ended.
函数位置
File: wp-includes/query.php.
函数源码
function in_the_loop() {
global $wp_query;
if ( ! isset( $wp_query ) ) {
return false;
}
return $wp_query->in_the_loop;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |

