函数原型
is_main_query(): bool
函数描述
Determines whether the query is the main query.
是否弃用
未弃用
函数参数
无
函数返回值
bool Whether the query is the main query.
函数位置
File: wp-includes/query.php.
函数源码
if ( is_main_query() ) {
// do stuff
}
源码链接
变更日志
Changelog| Version | Description |
|---|
| 3.3.0 | Introduced. |