From 6641104194b9309ba08c85b7f508fe22a4582183 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 20 Nov 2004 18:32:31 +0000 Subject: [PATCH] Add is_paged(). git-svn-id: https://develop.svn.wordpress.org/trunk@1871 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 cdacc9c4c4..610bff4f06 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 9e89f0dd6b..93fe485c19 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;