From d781edcc702ff8ba562643754603c1b962549f54 Mon Sep 17 00:00:00 2001 From: rboren Date: Sun, 26 Dec 2004 16:37:55 +0000 Subject: [PATCH] Add is_admin flag. Do not set is_home if is_admin. git-svn-id: http://svn.automattic.com/wordpress/trunk@2003 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/classes.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index be70578232..c910eb515e 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -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; } }