wpseek.com
WordPress开发者和主题制作者的搜索引擎



in_the_loop › WordPress Function

Since2.0.0
已弃用n/a
in_the_loop ( 没有参数 )
返回:
  • (bool) True if caller is within loop, false if loop hasn't started or ended.
定义在:
文档:

Determines whether the caller is in the Loop.

For more information on this and similar theme functions, check out the {@link Conditional Tags} article in the Theme Developer Handbook.


源码

function in_the_loop() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		return false;
	}

	return $wp_query->in_the_loop;
}