<!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-&gt;query) ) {
</span><span class="cx">                         $this-&gt;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-&gt;is_date) {
</del><ins>+                                if ( ! $this-&gt;is_date ) {
</ins><span class="cx">                                         $this-&gt;is_day = true;
</span><span class="cx">                                         $this-&gt;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-&gt;is_date) {
</del><ins>+                                if ( ! $this-&gt;is_date ) {
</ins><span class="cx">                                         $this-&gt;is_month = true;
</span><span class="cx">                                         $this-&gt;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-&gt;is_date) {
</del><ins>+                                if ( ! $this-&gt;is_date ) {
</ins><span class="cx">                                         $this-&gt;is_year = true;
</span><span class="cx">                                         $this-&gt;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-&gt;is_date = true;
</span><del>-                                if (strlen($qv['m']) &gt; 9) {
</del><ins>+                                if ( strlen($qv['m']) &gt; 9 ) {
</ins><span class="cx">                                         $this-&gt;is_time = true;
</span><del>-                                } else if (strlen($qv['m']) &gt; 7) {
</del><ins>+                                } else if ( strlen($qv['m']) &gt; 7 ) {
</ins><span class="cx">                                         $this-&gt;is_day = true;
</span><del>-                                } else if (strlen($qv['m']) &gt; 5) {
</del><ins>+                                } else if ( strlen($qv['m']) &gt; 5 ) {
</ins><span class="cx">                                         $this-&gt;is_month = true;
</span><span class="cx">                                 } else {
</span><span class="cx">                                         $this-&gt;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-&gt;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-&gt;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-&gt;is_category = false;
</span><span class="cx">                                 } else {
</span><span class="cx">                                         $this-&gt;is_category = true;
</span><span class="lines">@@ -1454,7 +1454,7 @@
</span><span class="cx">                         $this-&gt;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-&gt;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-&gt;is_singular = $this-&gt;is_single || $this-&gt;is_page || $this-&gt;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-&gt;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-&gt;init_query_flags();
</span><span class="cx">                 $this-&gt;is_404 = true;
</span><span class="cx"> 
</span><del>-                $this-&gt;is_feed = $is_feed;
</del><ins>+                //$this-&gt;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-&gt;query_vars[$query_var])) {
</del><ins>+                if ( isset($this-&gt;query_vars[$query_var]) )
</ins><span class="cx">                         return $this-&gt;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']) &amp;&amp; $q['posts_per_archive_page'] != 0) &amp;&amp; ($this-&gt;is_archive || $this-&gt;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 .= &quot; AND YEAR($wpdb-&gt;posts.post_date)=&quot; . substr($q['m'], 0, 4);
</span><del>-                        if (strlen($q['m'])&gt;5)
</del><ins>+                        if ( strlen($q['m']) &gt; 5 )
</ins><span class="cx">                                 $where .= &quot; AND MONTH($wpdb-&gt;posts.post_date)=&quot; . substr($q['m'], 4, 2);
</span><del>-                        if (strlen($q['m'])&gt;7)
</del><ins>+                        if ( strlen($q['m']) &gt; 7 )
</ins><span class="cx">                                 $where .= &quot; AND DAYOFMONTH($wpdb-&gt;posts.post_date)=&quot; . substr($q['m'], 6, 2);
</span><del>-                        if (strlen($q['m'])&gt;9)
</del><ins>+                        if ( strlen($q['m']) &gt; 9 )
</ins><span class="cx">                                 $where .= &quot; AND HOUR($wpdb-&gt;posts.post_date)=&quot; . substr($q['m'], 8, 2);
</span><del>-                        if (strlen($q['m'])&gt;11)
</del><ins>+                        if ( strlen($q['m']) &gt; 11 )
</ins><span class="cx">                                 $where .= &quot; AND MINUTE($wpdb-&gt;posts.post_date)=&quot; . substr($q['m'], 10, 2);
</span><del>-                        if (strlen($q['m'])&gt;13)
</del><ins>+                        if ( strlen($q['m']) &gt; 13 )
</ins><span class="cx">                                 $where .= &quot; AND SECOND($wpdb-&gt;posts.post_date)=&quot; . 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-&gt;query_var || empty($q[ $ptype_obj-&gt;query_var ]) )
</span><span class="cx">                                         continue;
</span><span class="cx"> 
</span><del>-                                if ( ! $ptype_obj-&gt;hierarchical || strpos($q[ $ptype_obj-&gt;query_var ], '/') === false) {
</del><ins>+                                if ( ! $ptype_obj-&gt;hierarchical || strpos($q[ $ptype_obj-&gt;query_var ], '/') === false ) {
</ins><span class="cx">                                         // Non-hierarchical post_types &amp; parent-level-hierarchical post_types can directly use 'name'
</span><span class="cx">                                         $q['name'] = $q[ $ptype_obj-&gt;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 .= &quot;{$searchand}(($wpdb-&gt;posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb-&gt;posts.post_content LIKE '{$n}{$term}{$n}'))&quot;;
</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' =&gt; 'category', 'tag__and' =&gt; 'post_tag', 'tag_slug__and' =&gt; 'post_tag', 'tag__in' =&gt; 'post_tag', 'tag_slug__in' =&gt; '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 =&gt; $taxonomy) {
</del><ins>+                foreach ( $intersections as $item =&gt; $taxonomy ) {
</ins><span class="cx">                         if ( empty($q[$item]) ) continue;
</span><span class="cx">                         if ( in_array($item, $tagin) &amp;&amp; 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 .= &quot; AND ($wpdb-&gt;posts.post_author &quot;.$eq.' '.absint($author_array[0]);
-                        for ($i = 1; $i &lt; (count($author_array)); $i = $i + 1) {
-                                $whichauthor .= ' '.$andor.&quot; $wpdb-&gt;posts.post_author &quot;.$eq.' '.absint($author_array[$i]);
-                        }
-                        $whichauthor .= ')';
</del><ins>+                        $_author_array = array();
+                        foreach ( $author_array as $key =&gt; $_author )
+                                $_author_array[] = &quot;$wpdb-&gt;posts.post_author &quot; . $eq . ' ' . absint($_author);
+                        $whichauthor .= ' AND (' . implode(&quot; $andor &quot;, $_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']-&gt;ID;
</span><del>-                        $whichauthor .= &quot; AND ($wpdb-&gt;posts.post_author = &quot;.absint($q['author']).')';
</del><ins>+                        $whichauthor .= &quot; AND ($wpdb-&gt;posts.post_author = &quot; . 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']) &amp;&amp; '' != $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') &amp;&amp; (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'] = &quot;$wpdb-&gt;posts.post_date &quot;.$q['order'];
</del><ins>+                        $q['orderby'] = &quot;$wpdb-&gt;posts.post_date &quot; . $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-&gt;is_attachment ) {
</span><span class="cx">                         $where .= &quot; AND $wpdb-&gt;posts.post_type = 'attachment'&quot;;
</span><span class="cx">                         $post_type_object = get_post_type_object ( 'attachment' );
</span><del>-                } elseif ($this-&gt;is_page) {
</del><ins>+                } elseif ( $this-&gt;is_page ) {
</ins><span class="cx">                         $where .= &quot; AND $wpdb-&gt;posts.post_type = 'page'&quot;;
</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-&gt;comments as $comment)
</del><ins>+                        foreach ( $this-&gt;comments as $comment )
</ins><span class="cx">                                 $post_ids[] = (int) $comment-&gt;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-&gt;protected ) {
</span><span class="cx">                                                 // User must have edit permissions on the draft to preview.
</span><del>-                                                if (! current_user_can($edit_cap, $this-&gt;posts[0]-&gt;ID)) {
</del><ins>+                                                if ( ! current_user_can($edit_cap, $this-&gt;posts[0]-&gt;ID) ) {
</ins><span class="cx">                                                         $this-&gt;posts = array();
</span><span class="cx">                                                 } else {
</span><span class="cx">                                                         $this-&gt;is_preview = true;
</span><del>-                                                        if ('future' != $status)
</del><ins>+                                                        if ( 'future' != $status )
</ins><span class="cx">                                                                 $this-&gt;posts[0]-&gt;post_date = current_time('mysql');
</span><span class="cx">                                                 }
</span><span class="cx">                                         } elseif ( $post_status_obj-&gt;private ) {
</span><span class="lines">@@ -2497,14 +2496,14 @@
</span><span class="cx">                 $this-&gt;post_count = count($this-&gt;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 &lt; $this-&gt;post_count; $i++) {
</del><ins>+                for ( $i = 0; $i &lt; $this-&gt;post_count; $i++ ) {
</ins><span class="cx">                         $this-&gt;posts[$i] = sanitize_post($this-&gt;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-&gt;posts, $post_type);
</span><span class="cx"> 
</span><del>-                if ($this-&gt;post_count &gt; 0) {
</del><ins>+                if ( $this-&gt;post_count &gt; 0 ) {
</ins><span class="cx">                         $this-&gt;post = $this-&gt;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-&gt;current_post + 1 &lt; $this-&gt;post_count) {
</del><ins>+                if ( $this-&gt;current_post + 1 &lt; $this-&gt;post_count ) {
</ins><span class="cx">                         return true;
</span><del>-                } elseif ($this-&gt;current_post + 1 == $this-&gt;post_count &amp;&amp; $this-&gt;post_count &gt; 0) {
</del><ins>+                } elseif ( $this-&gt;current_post + 1 == $this-&gt;post_count &amp;&amp; $this-&gt;post_count &gt; 0 ) {
</ins><span class="cx">                         do_action_ref_array('loop_end', array(&amp;$this));
</span><span class="cx">                         // Do some cleaning up after the loop
</span><span class="cx">                         $this-&gt;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-&gt;current_post = -1;
</span><del>-                if ($this-&gt;post_count &gt; 0) {
</del><ins>+                if ( $this-&gt;post_count &gt; 0 ) {
</ins><span class="cx">                         $this-&gt;post = $this-&gt;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-&gt;next_comment();
</span><span class="cx"> 
</span><del>-                if ($this-&gt;current_comment == 0) {
</del><ins>+                if ( $this-&gt;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-&gt;current_comment + 1 &lt; $this-&gt;comment_count) {
</del><ins>+                if ( $this-&gt;current_comment + 1 &lt; $this-&gt;comment_count ) {
</ins><span class="cx">                         return true;
</span><del>-                } elseif ($this-&gt;current_comment + 1 == $this-&gt;comment_count) {
</del><ins>+                } elseif ( $this-&gt;current_comment + 1 == $this-&gt;comment_count ) {
</ins><span class="cx">                         $this-&gt;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-&gt;current_comment = -1;
</span><del>-                if ($this-&gt;comment_count &gt; 0) {
</del><ins>+                if ( $this-&gt;comment_count &gt; 0 ) {
</ins><span class="cx">                         $this-&gt;comment = $this-&gt;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-&gt;get_queried_object();
</span><span class="cx"> 
</span><del>-                if (isset($this-&gt;queried_object_id)) {
</del><ins>+                if ( isset($this-&gt;queried_object_id) ) {
</ins><span class="cx">                         return $this-&gt;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-&gt;query($query);
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>