函数原型
is_admin(): bool
函数描述
Determines whether the current request is for an administrative interface page.
是否弃用
未弃用
函数参数
无
函数返回值
bool True if inside WordPress administration interface, false otherwise.
函数位置
File: wp-includes/load.php.
函数源码
function is_admin() {
if ( isset( $GLOBALS['current_screen'] ) ) {
return $GLOBALS['current_screen']->in_admin();
} elseif ( defined( 'WP_ADMIN' ) ) {
return WP_ADMIN;
}
return false;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.1 | Introduced. |

