From 2201be3af32406a9a60729d35533ccecd731538b Mon Sep 17 00:00:00 2001 From: rboren Date: Sat, 20 Nov 2004 18:32:31 +0000 Subject: [PATCH] Add is_paged(). git-svn-id: http://svn.automattic.com/wordpress/trunk@1871 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/classes.php | 7 ++++++- wp-includes/functions.php | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wp-includes/classes.php b/wp-includes/classes.php index cdacc9c4c..610bff4f0 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -41,6 +41,7 @@ class WP_Query { $this->is_feed = false; $this->is_home = false; $this->is_404 = false; + $this->is_paged = false; unset($this->posts); unset($this->query); @@ -171,7 +172,11 @@ class WP_Query { $this->is_404 = true; } - if ( ($this->is_date || $this->is_author || $this->is_category) + if ('' != $qv['paged']) { + $this->is_paged = true; + } + + if ( ($this->is_date || $this->is_author || $this->is_category || $this->is_paged) && (! ($this->is_single || $this->is_page)) ) { $this->is_archive = true; } diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 9e89f0dd6..93fe485c1 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1986,6 +1986,12 @@ function is_404 () { return $wp_query->is_404; } +function is_paged () { + global $wp_query; + + return $wp_query->is_paged; +} + function get_query_var($var) { global $wp_query;