wordpress is_admin函数

检测后台管理员面板是否要被显示,不是检测当前用户是否有权限查看后台,如果地址到达了后台区域,返回true,否则返回false

if ( ! is_admin() ) {
     echo "You are viewing the theme";
} else {
     echo "You are viewing the WordPress Administration Panels";
}

此处评论已关闭