Add is_admin flag. Do not set is_home if is_admin.

git-svn-id: https://develop.svn.wordpress.org/trunk@2003 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-12-26 16:37:55 +00:00
parent 173eb4a098
commit ef5346f4bf

View File

@ -26,6 +26,7 @@ class WP_Query {
var $is_trackback = false;
var $is_home = false;
var $is_404 = false;
var $is_admin = false;
function init () {
$this->is_single = false;
@ -44,6 +45,7 @@ class WP_Query {
$this->is_home = false;
$this->is_404 = false;
$this->is_paged = false;
$this->is_admin = false;
unset($this->posts);
unset($this->query);
@ -175,7 +177,11 @@ class WP_Query {
$this->is_paged = true;
}
if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404)) {
if (strstr($_SERVER['PHP_SELF'], 'wp-admin/')) {
$this->is_admin = true;
}
if ( ! ($this->is_archive || $this->is_single || $this->is_page || $this->is_search || $this->is_feed || $this->is_trackback || $this->is_404 || $this->is_admin)) {
$this->is_home = true;
}
}