WP_Query whitespace cleanup, some loop cleanup as well
git-svn-id: http://svn.automattic.com/wordpress/trunk@14401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
efa2e9d397
commit
e840bb1167
|
@ -1545,7 +1545,7 @@ class WP_Query {
|
|||
$this->init_query_flags();
|
||||
$this->is_404 = true;
|
||||
|
||||
$this->is_feed = $is_feed;
|
||||
//$this->is_feed = $is_feed;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1558,9 +1558,8 @@ class WP_Query {
|
|||
* @return mixed
|
||||
*/
|
||||
function get($query_var) {
|
||||
if (isset($this->query_vars[$query_var])) {
|
||||
if ( isset($this->query_vars[$query_var]) )
|
||||
return $this->query_vars[$query_var];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
@ -2046,23 +2045,23 @@ class WP_Query {
|
|||
if ( empty($q['author']) || ($q['author'] == '0') ) {
|
||||
$whichauthor = '';
|
||||
} else {
|
||||
$q['author'] = ''.urldecode($q['author']).'';
|
||||
$q['author'] = (string)urldecode($q['author']);
|
||||
$q['author'] = addslashes_gpc($q['author']);
|
||||
if ( strpos($q['author'], '-') !== false ) {
|
||||
$eq = '!=';
|
||||
$andor = 'AND';
|
||||
$q['author'] = explode('-', $q['author']);
|
||||
$q['author'] = '' . absint($q['author'][1]);
|
||||
$q['author'] = (string)absint($q['author'][1]);
|
||||
} else {
|
||||
$eq = '=';
|
||||
$andor = 'OR';
|
||||
}
|
||||
$author_array = preg_split('/[,\s]+/', $q['author']);
|
||||
$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 .= ')';
|
||||
$_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);
|
||||
}
|
||||
|
||||
// Author stuff for nice URLs
|
||||
|
|
Loading…
Reference in New Issue