Use the object's is_* vars instead of the global is_* functions.

git-svn-id: https://develop.svn.wordpress.org/trunk@2300 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-02-13 19:45:04 +00:00
parent 6ee469cf88
commit 3d321e23a5
1 changed files with 4 additions and 4 deletions

View File

@ -235,7 +235,7 @@ class WP_Query {
$q['showposts'] = (int) $q['showposts']; $q['showposts'] = (int) $q['showposts'];
$q['posts_per_page'] = $q['showposts']; $q['posts_per_page'] = $q['showposts'];
} }
if ( (isset($q['posts_per_archive_page']) && $q['posts_per_archive_page'] != 0) && (is_archive() || is_search()) ) if ( (isset($q['posts_per_archive_page']) && $q['posts_per_archive_page'] != 0) && ($this->is_archive || $this->is_search) )
$q['posts_per_page'] = $q['posts_per_archive_page']; $q['posts_per_page'] = $q['posts_per_archive_page'];
if ( !isset($q['nopaging']) ) { if ( !isset($q['nopaging']) ) {
if ($q['posts_per_page'] == -1) { if ($q['posts_per_page'] == -1) {
@ -355,7 +355,7 @@ class WP_Query {
if ((empty($q['cat'])) || ($q['cat'] == '0') || if ((empty($q['cat'])) || ($q['cat'] == '0') ||
// Bypass cat checks if fetching specific posts // Bypass cat checks if fetching specific posts
( is_single() || is_page() )) { ( $this->is_single || $this->is_page )) {
$whichcat=''; $whichcat='';
} else { } else {
$q['cat'] = ''.urldecode($q['cat']).''; $q['cat'] = ''.urldecode($q['cat']).'';
@ -482,7 +482,7 @@ class WP_Query {
$distinct = 'DISTINCT'; $distinct = 'DISTINCT';
} }
if (is_page()) { if ($this->is_page) {
$where .= ' AND (post_status = "static"'; $where .= ' AND (post_status = "static"';
} else { } else {
$where .= ' AND (post_status = "publish"'; $where .= ' AND (post_status = "publish"';
@ -500,7 +500,7 @@ class WP_Query {
$join = apply_filters('posts_join', $join); $join = apply_filters('posts_join', $join);
// Paging // Paging
if (empty($q['nopaging']) && ! is_single()) { if (empty($q['nopaging']) && ! $this->is_single) {
$page = $q['paged']; $page = $q['paged'];
if (empty($page)) { if (empty($page)) {
$page = 1; $page = 1;