<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14401] trunk/wp-includes/query.php: WP_Query whitespace cleanup,
some loop cleanup as well</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14401">14401</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-05-03 20:19:13 +0000 (Mon, 03 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>WP_Query whitespace cleanup, some loop cleanup as well</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesqueryphp">trunk/wp-includes/query.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesqueryphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/query.php (14400 => 14401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/query.php        2010-05-03 20:17:01 UTC (rev 14400)
+++ trunk/wp-includes/query.php        2010-05-03 20:19:13 UTC (rev 14401)
</span><span class="lines">@@ -1204,7 +1204,7 @@
</span><span class="cx">                         , 'sentence'
</span><span class="cx">                 );
</span><span class="cx">
</span><del>-                foreach ($keys as $key) {
</del><ins>+                foreach ( $keys as $key ) {
</ins><span class="cx">                         if ( !isset($array[$key]))
</span><span class="cx">                                 $array[$key] = '';
</span><span class="cx">                 }
</span><span class="lines">@@ -1227,7 +1227,7 @@
</span><span class="cx">          *
</span><span class="cx">          * @param string|array $query
</span><span class="cx">          */
</span><del>-        function parse_query($query) {
</del><ins>+        function parse_query($query ) {
</ins><span class="cx">                 if ( !empty($query) || !isset($this->query) ) {
</span><span class="cx">                         $this->init();
</span><span class="cx">                         if ( is_array($query) )
</span><span class="lines">@@ -1301,21 +1301,21 @@
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if ( $qv['day'] ) {
</span><del>-                                if (! $this->is_date) {
</del><ins>+                                if ( ! $this->is_date ) {
</ins><span class="cx">                                         $this->is_day = true;
</span><span class="cx">                                         $this->is_date = true;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if ( $qv['monthnum'] ) {
</span><del>-                                if (! $this->is_date) {
</del><ins>+                                if ( ! $this->is_date ) {
</ins><span class="cx">                                         $this->is_month = true;
</span><span class="cx">                                         $this->is_date = true;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if ( $qv['year'] ) {
</span><del>-                                if (! $this->is_date) {
</del><ins>+                                if ( ! $this->is_date ) {
</ins><span class="cx">                                         $this->is_year = true;
</span><span class="cx">                                         $this->is_date = true;
</span><span class="cx">                                 }
</span><span class="lines">@@ -1323,25 +1323,25 @@
</span><span class="cx">
</span><span class="cx">                         if ( $qv['m'] ) {
</span><span class="cx">                                 $this->is_date = true;
</span><del>-                                if (strlen($qv['m']) > 9) {
</del><ins>+                                if ( strlen($qv['m']) > 9 ) {
</ins><span class="cx">                                         $this->is_time = true;
</span><del>-                                } else if (strlen($qv['m']) > 7) {
</del><ins>+                                } else if ( strlen($qv['m']) > 7 ) {
</ins><span class="cx">                                         $this->is_day = true;
</span><del>-                                } else if (strlen($qv['m']) > 5) {
</del><ins>+                                } else if ( strlen($qv['m']) > 5 ) {
</ins><span class="cx">                                         $this->is_month = true;
</span><span class="cx">                                 } else {
</span><span class="cx">                                         $this->is_year = true;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if ('' != $qv['w']) {
</del><ins>+                        if ( '' != $qv['w'] ) {
</ins><span class="cx">                                 $this->is_date = true;
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if ( empty($qv['cat']) || ($qv['cat'] == '0') ) {
</span><span class="cx">                                 $this->is_category = false;
</span><span class="cx">                         } else {
</span><del>-                                if (strpos($qv['cat'], '-') !== false) {
</del><ins>+                                if ( strpos($qv['cat'], '-') !== false ) {
</ins><span class="cx">                                         $this->is_category = false;
</span><span class="cx">                                 } else {
</span><span class="cx">                                         $this->is_category = true;
</span><span class="lines">@@ -1454,7 +1454,7 @@
</span><span class="cx">                         $this->is_comments_popup = true;
</span><span class="cx">
</span><span class="cx">                 // if we're previewing inside the write screen
</span><del>-                if ('' != $qv['preview'])
</del><ins>+                if ( '' != $qv['preview'] )
</ins><span class="cx">                         $this->is_preview = true;
</span><span class="cx">
</span><span class="cx">                 if ( is_admin() )
</span><span class="lines">@@ -1510,8 +1510,8 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ( !empty($qv['post_type']) )        {
-                        if(is_array($qv['post_type']))
</del><ins>+                if ( !empty($qv['post_type']) ) {
+                        if ( is_array($qv['post_type']) )
</ins><span class="cx">                                 $qv['post_type'] = array_map('sanitize_user', $qv['post_type'], array(true));
</span><span class="cx">                         else
</span><span class="cx">                                 $qv['post_type'] = sanitize_user($qv['post_type'], true);
</span><span class="lines">@@ -1526,7 +1526,7 @@
</span><span class="cx">                 $this->is_singular = $this->is_single || $this->is_page || $this->is_attachment;
</span><span class="cx">                 // Done correcting is_* for page_on_front and page_for_posts
</span><span class="cx">
</span><del>-                if ('404' == $qv['error'])
</del><ins>+                if ( '404' == $qv['error'] )
</ins><span class="cx">                         $this->set_404();
</span><span class="cx">
</span><span class="cx">                 if ( !empty($query) )
</span><span class="lines">@@ -1545,7 +1545,7 @@
</span><span class="cx">                 $this->init_query_flags();
</span><span class="cx">                 $this->is_404 = true;
</span><span class="cx">
</span><del>-                $this->is_feed = $is_feed;
</del><ins>+                //$this->is_feed = $is_feed;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /**
</span><span class="lines">@@ -1558,9 +1558,8 @@
</span><span class="cx">          * @return mixed
</span><span class="cx">          */
</span><span class="cx">         function get($query_var) {
</span><del>-                if (isset($this->query_vars[$query_var])) {
</del><ins>+                if ( isset($this->query_vars[$query_var]) )
</ins><span class="cx">                         return $this->query_vars[$query_var];
</span><del>-                }
</del><span class="cx">
</span><span class="cx">                 return '';
</span><span class="cx">         }
</span><span class="lines">@@ -1639,7 +1638,7 @@
</span><span class="cx">                 if ( (isset($q['posts_per_archive_page']) && $q['posts_per_archive_page'] != 0) && ($this->is_archive || $this->is_search) )
</span><span class="cx">                         $q['posts_per_page'] = $q['posts_per_archive_page'];
</span><span class="cx">                 if ( !isset($q['nopaging']) ) {
</span><del>-                        if ($q['posts_per_page'] == -1) {
</del><ins>+                        if ( $q['posts_per_page'] == -1 ) {
</ins><span class="cx">                                 $q['nopaging'] = true;
</span><span class="cx">                         } else {
</span><span class="cx">                                 $q['nopaging'] = false;
</span><span class="lines">@@ -1664,7 +1663,7 @@
</span><span class="cx">                         $q['page_id'] = get_option('page_on_front');
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (isset($q['page'])) {
</del><ins>+                if ( isset($q['page']) ) {
</ins><span class="cx">                         $q['page'] = trim($q['page'], '/');
</span><span class="cx">                         $q['page'] = absint($q['page']);
</span><span class="cx">                 }
</span><span class="lines">@@ -1679,15 +1678,15 @@
</span><span class="cx">                 if ( $q['m'] ) {
</span><span class="cx">                         $q['m'] = '' . preg_replace('|[^0-9]|', '', $q['m']);
</span><span class="cx">                         $where .= " AND YEAR($wpdb->posts.post_date)=" . substr($q['m'], 0, 4);
</span><del>-                        if (strlen($q['m'])>5)
</del><ins>+                        if ( strlen($q['m']) > 5 )
</ins><span class="cx">                                 $where .= " AND MONTH($wpdb->posts.post_date)=" . substr($q['m'], 4, 2);
</span><del>-                        if (strlen($q['m'])>7)
</del><ins>+                        if ( strlen($q['m']) > 7 )
</ins><span class="cx">                                 $where .= " AND DAYOFMONTH($wpdb->posts.post_date)=" . substr($q['m'], 6, 2);
</span><del>-                        if (strlen($q['m'])>9)
</del><ins>+                        if ( strlen($q['m']) > 9 )
</ins><span class="cx">                                 $where .= " AND HOUR($wpdb->posts.post_date)=" . substr($q['m'], 8, 2);
</span><del>-                        if (strlen($q['m'])>11)
</del><ins>+                        if ( strlen($q['m']) > 11 )
</ins><span class="cx">                                 $where .= " AND MINUTE($wpdb->posts.post_date)=" . substr($q['m'], 10, 2);
</span><del>-                        if (strlen($q['m'])>13)
</del><ins>+                        if ( strlen($q['m']) > 13 )
</ins><span class="cx">                                 $where .= " AND SECOND($wpdb->posts.post_date)=" . substr($q['m'], 12, 2);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1716,7 +1715,7 @@
</span><span class="cx">                                 if ( !$ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) )
</span><span class="cx">                                         continue;
</span><span class="cx">
</span><del>-                                if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ], '/') === false) {
</del><ins>+                                if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ], '/') === false ) {
</ins><span class="cx">                                         // Non-hierarchical post_types & parent-level-hierarchical post_types can directly use 'name'
</span><span class="cx">                                         $q['name'] = $q[ $ptype_obj->query_var ];
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -1773,7 +1772,7 @@
</span><span class="cx">                                         $q['attachment_id'] = $reqpage;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                } elseif ('' != $q['attachment']) {
</del><ins>+                } elseif ( '' != $q['attachment'] ) {
</ins><span class="cx">                         $q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment'])));
</span><span class="cx">                         $attach_paths = '/' . trim($q['attachment'], '/');
</span><span class="cx">                         $q['attachment'] = sanitize_title(basename($attach_paths));
</span><span class="lines">@@ -1824,7 +1823,7 @@
</span><span class="cx">                         }
</span><span class="cx">                         $n = !empty($q['exact']) ? '' : '%';
</span><span class="cx">                         $searchand = '';
</span><del>-                        foreach( (array) $q['search_terms'] as $term) {
</del><ins>+                        foreach( (array) $q['search_terms'] as $term ) {
</ins><span class="cx">                                 $term = addslashes_gpc($term);
</span><span class="cx">                                 $search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
</span><span class="cx">                                 $searchand = ' AND ';
</span><span class="lines">@@ -1968,7 +1967,7 @@
</span><span class="cx">                 // Tag and slug intersections.
</span><span class="cx">                 $intersections = array('category__and' => 'category', 'tag__and' => 'post_tag', 'tag_slug__and' => 'post_tag', 'tag__in' => 'post_tag', 'tag_slug__in' => 'post_tag');
</span><span class="cx">                 $tagin = array('tag__in', 'tag_slug__in'); // These are used to make some exceptions below
</span><del>-                foreach ($intersections as $item => $taxonomy) {
</del><ins>+                foreach ( $intersections as $item => $taxonomy ) {
</ins><span class="cx">                         if ( empty($q[$item]) ) continue;
</span><span class="cx">                         if ( in_array($item, $tagin) && empty($q['cat']) ) continue; // We should already have what we need if categories aren't being used
</span><span class="cx">
</span><span class="lines">@@ -2044,43 +2043,43 @@
</span><span class="cx">                 // Author/user stuff
</span><span class="cx">
</span><span class="cx">                 if ( empty($q['author']) || ($q['author'] == '0') ) {
</span><del>-                        $whichauthor='';
</del><ins>+                        $whichauthor = '';
</ins><span class="cx">                 } else {
</span><del>-                        $q['author'] = ''.urldecode($q['author']).'';
</del><ins>+                        $q['author'] = (string)urldecode($q['author']);
</ins><span class="cx">                         $q['author'] = addslashes_gpc($q['author']);
</span><del>-                        if (strpos($q['author'], '-') !== false) {
</del><ins>+                        if ( strpos($q['author'], '-') !== false ) {
</ins><span class="cx">                                 $eq = '!=';
</span><span class="cx">                                 $andor = 'AND';
</span><span class="cx">                                 $q['author'] = explode('-', $q['author']);
</span><del>-                                $q['author'] = '' . absint($q['author'][1]);
</del><ins>+                                $q['author'] = (string)absint($q['author'][1]);
</ins><span class="cx">                         } else {
</span><span class="cx">                                 $eq = '=';
</span><span class="cx">                                 $andor = 'OR';
</span><span class="cx">                         }
</span><span class="cx">                         $author_array = preg_split('/[,\s]+/', $q['author']);
</span><del>-                        $whichauthor .= " AND ($wpdb->posts.post_author ".$eq.' '.absint($author_array[0]);
-                        for ($i = 1; $i < (count($author_array)); $i = $i + 1) {
-                                $whichauthor .= ' '.$andor." $wpdb->posts.post_author ".$eq.' '.absint($author_array[$i]);
-                        }
-                        $whichauthor .= ')';
</del><ins>+                        $_author_array = array();
+                        foreach ( $author_array as $key => $_author )
+                                $_author_array[] = "$wpdb->posts.post_author " . $eq . ' ' . absint($_author);
+                        $whichauthor .= ' AND (' . implode(" $andor ", $_author_array) . ')';
+                        unset($author_array, $_author_array);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 // Author stuff for nice URLs
</span><span class="cx">
</span><del>-                if ('' != $q['author_name']) {
-                        if (strpos($q['author_name'], '/') !== false) {
-                                $q['author_name'] = explode('/',$q['author_name']);
-                                if ($q['author_name'][count($q['author_name'])-1]) {
-                                        $q['author_name'] = $q['author_name'][count($q['author_name'])-1];#no trailing slash
</del><ins>+                if ( '' != $q['author_name'] ) {
+                        if ( strpos($q['author_name'], '/') !== false ) {
+                                $q['author_name'] = explode('/', $q['author_name']);
+                                if ( $q['author_name'][ count($q['author_name'])-1 ] ) {
+                                        $q['author_name'] = $q['author_name'][count($q['author_name'])-1]; #no trailing slash
</ins><span class="cx">                                 } else {
</span><del>-                                        $q['author_name'] = $q['author_name'][count($q['author_name'])-2];#there was a trailling slash
</del><ins>+                                        $q['author_name'] = $q['author_name'][count($q['author_name'])-2]; #there was a trailling slash
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         $q['author_name'] = sanitize_title($q['author_name']);
</span><span class="cx">                         $q['author'] = get_user_by('slug', $q['author_name']);
</span><span class="cx">                         if ( $q['author'] )
</span><span class="cx">                                 $q['author'] = $q['author']->ID;
</span><del>-                        $whichauthor .= " AND ($wpdb->posts.post_author = ".absint($q['author']).')';
</del><ins>+                        $whichauthor .= " AND ($wpdb->posts.post_author = " . absint($q['author']) . ')';
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 // MIME-Type stuff for attachment browsing
</span><span class="lines">@@ -2088,14 +2087,14 @@
</span><span class="cx">                 if ( isset($q['post_mime_type']) && '' != $q['post_mime_type'] )
</span><span class="cx">                         $whichmimetype = wp_post_mime_type_where($q['post_mime_type']);
</span><span class="cx">
</span><del>-                $where .= $search.$whichcat.$whichauthor.$whichmimetype;
</del><ins>+                $where .= $search . $whichcat . $whichauthor . $whichmimetype;
</ins><span class="cx">
</span><span class="cx">                 if ( empty($q['order']) || ((strtoupper($q['order']) != 'ASC') && (strtoupper($q['order']) != 'DESC')) )
</span><span class="cx">                         $q['order'] = 'DESC';
</span><span class="cx">
</span><span class="cx">                 // Order by
</span><span class="cx">                 if ( empty($q['orderby']) ) {
</span><del>-                        $q['orderby'] = "$wpdb->posts.post_date ".$q['order'];
</del><ins>+                        $q['orderby'] = "$wpdb->posts.post_date " . $q['order'];
</ins><span class="cx">                 } elseif ( 'none' == $q['orderby'] ) {
</span><span class="cx">                         $q['orderby'] = '';
</span><span class="cx">                 } else {
</span><span class="lines">@@ -2116,7 +2115,7 @@
</span><span class="cx">                                 if ( ! in_array($orderby, $allowed_keys) )
</span><span class="cx">                                         continue;
</span><span class="cx">
</span><del>-                                switch ($orderby) {
</del><ins>+                                switch ( $orderby ) {
</ins><span class="cx">                                         case 'menu_order':
</span><span class="cx">                                                 break;
</span><span class="cx">                                         case 'ID':
</span><span class="lines">@@ -2174,7 +2173,7 @@
</span><span class="cx">                 } elseif ( $this->is_attachment ) {
</span><span class="cx">                         $where .= " AND $wpdb->posts.post_type = 'attachment'";
</span><span class="cx">                         $post_type_object = get_post_type_object ( 'attachment' );
</span><del>-                } elseif ($this->is_page) {
</del><ins>+                } elseif ( $this->is_page ) {
</ins><span class="cx">                         $where .= " AND $wpdb->posts.post_type = 'page'";
</span><span class="cx">                         $post_type_object = get_post_type_object ( 'page' );
</span><span class="cx">                 } else {
</span><span class="lines">@@ -2298,7 +2297,7 @@
</span><span class="cx">                         if ( empty($q['offset']) ) {
</span><span class="cx">                                 $pgstrt = '';
</span><span class="cx">                                 $pgstrt = ($page - 1) * $q['posts_per_page'] . ', ';
</span><del>-                                $limits = 'LIMIT '.$pgstrt.$q['posts_per_page'];
</del><ins>+                                $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
</ins><span class="cx">                         } else { // we're ignoring $page and using 'offset'
</span><span class="cx">                                 $q['offset'] = absint($q['offset']);
</span><span class="cx">                                 $pgstrt = $q['offset'] . ', ';
</span><span class="lines">@@ -2333,7 +2332,7 @@
</span><span class="cx">
</span><span class="cx">                         $post_ids = array();
</span><span class="cx">
</span><del>-                        foreach ($this->comments as $comment)
</del><ins>+                        foreach ( $this->comments as $comment )
</ins><span class="cx">                                 $post_ids[] = (int) $comment->comment_post_ID;
</span><span class="cx">
</span><span class="cx">                         $post_ids = join(',', $post_ids);
</span><span class="lines">@@ -2421,11 +2420,11 @@
</span><span class="cx">                                 } else {
</span><span class="cx">                                         if ( $post_status_obj->protected ) {
</span><span class="cx">                                                 // User must have edit permissions on the draft to preview.
</span><del>-                                                if (! current_user_can($edit_cap, $this->posts[0]->ID)) {
</del><ins>+                                                if ( ! current_user_can($edit_cap, $this->posts[0]->ID) ) {
</ins><span class="cx">                                                         $this->posts = array();
</span><span class="cx">                                                 } else {
</span><span class="cx">                                                         $this->is_preview = true;
</span><del>-                                                        if ('future' != $status)
</del><ins>+                                                        if ( 'future' != $status )
</ins><span class="cx">                                                                 $this->posts[0]->post_date = current_time('mysql');
</span><span class="cx">                                                 }
</span><span class="cx">                                         } elseif ( $post_status_obj->private ) {
</span><span class="lines">@@ -2497,14 +2496,14 @@
</span><span class="cx">                 $this->post_count = count($this->posts);
</span><span class="cx">
</span><span class="cx">                 // Sanitize before caching so it'll only get done once
</span><del>-                for ($i = 0; $i < $this->post_count; $i++) {
</del><ins>+                for ( $i = 0; $i < $this->post_count; $i++ ) {
</ins><span class="cx">                         $this->posts[$i] = sanitize_post($this->posts[$i], 'raw');
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if ( $q['cache_results'] )
</span><span class="cx">                         update_post_caches($this->posts, $post_type);
</span><span class="cx">
</span><del>-                if ($this->post_count > 0) {
</del><ins>+                if ( $this->post_count > 0 ) {
</ins><span class="cx">                         $this->post = $this->posts[0];
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -2561,9 +2560,9 @@
</span><span class="cx">          * @return bool True if posts are available, false if end of loop.
</span><span class="cx">          */
</span><span class="cx">         function have_posts() {
</span><del>-                if ($this->current_post + 1 < $this->post_count) {
</del><ins>+                if ( $this->current_post + 1 < $this->post_count ) {
</ins><span class="cx">                         return true;
</span><del>-                } elseif ($this->current_post + 1 == $this->post_count && $this->post_count > 0) {
</del><ins>+                } elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
</ins><span class="cx">                         do_action_ref_array('loop_end', array(&$this));
</span><span class="cx">                         // Do some cleaning up after the loop
</span><span class="cx">                         $this->rewind_posts();
</span><span class="lines">@@ -2581,7 +2580,7 @@
</span><span class="cx">          */
</span><span class="cx">         function rewind_posts() {
</span><span class="cx">                 $this->current_post = -1;
</span><del>-                if ($this->post_count > 0) {
</del><ins>+                if ( $this->post_count > 0 ) {
</ins><span class="cx">                         $this->post = $this->posts[0];
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -2614,7 +2613,7 @@
</span><span class="cx">
</span><span class="cx">                 $comment = $this->next_comment();
</span><span class="cx">
</span><del>-                if ($this->current_comment == 0) {
</del><ins>+                if ( $this->current_comment == 0 ) {
</ins><span class="cx">                         do_action('comment_loop_start');
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -2630,9 +2629,9 @@
</span><span class="cx">          * @return bool True, if more comments. False, if no more posts.
</span><span class="cx">          */
</span><span class="cx">         function have_comments() {
</span><del>-                if ($this->current_comment + 1 < $this->comment_count) {
</del><ins>+                if ( $this->current_comment + 1 < $this->comment_count ) {
</ins><span class="cx">                         return true;
</span><del>-                } elseif ($this->current_comment + 1 == $this->comment_count) {
</del><ins>+                } elseif ( $this->current_comment + 1 == $this->comment_count ) {
</ins><span class="cx">                         $this->rewind_comments();
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -2647,7 +2646,7 @@
</span><span class="cx">          */
</span><span class="cx">         function rewind_comments() {
</span><span class="cx">                 $this->current_comment = -1;
</span><del>-                if ($this->comment_count > 0) {
</del><ins>+                if ( $this->comment_count > 0 ) {
</ins><span class="cx">                         $this->comment = $this->comments[0];
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -2738,7 +2737,7 @@
</span><span class="cx">         function get_queried_object_id() {
</span><span class="cx">                 $this->get_queried_object();
</span><span class="cx">
</span><del>-                if (isset($this->queried_object_id)) {
</del><ins>+                if ( isset($this->queried_object_id) ) {
</ins><span class="cx">                         return $this->queried_object_id;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -2757,7 +2756,7 @@
</span><span class="cx">          * @return WP_Query
</span><span class="cx">          */
</span><span class="cx">         function WP_Query($query = '') {
</span><del>-                if (! empty($query)) {
</del><ins>+                if ( ! empty($query) ) {
</ins><span class="cx">                         $this->query($query);
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre>
</div>
</div>
</body>
</html>