Changeset 4129
- Timestamp:
- 08/30/2006 05:41:38 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r4122 r4129 95 95 $this->query_vars = array(); 96 96 97 if (! empty($extra_query_vars)) 97 if ( is_array($extra_query_vars) ) 98 $this->extra_query_vars = & $extra_query_vars; 99 else if (! empty($extra_query_vars)) 98 100 parse_str($extra_query_vars, $this->extra_query_vars); 99 101 … … 213 215 elseif (!empty($perma_query_vars[$wpvar])) 214 216 $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; 215 else 216 $this->query_vars[$wpvar] = ''; 217 } 218 219 for ($i=0; $i<count($this->private_query_vars); $i += 1) { 220 $wpvar = $this->private_query_vars[$i]; 221 if (isset($this->extra_query_vars[$wpvar])) 222 $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar]; 217 } 218 219 foreach ($this->private_query_vars as $var) { 220 if (isset($GLOBALS[$var]) && '' != $GLOBALS[$var] && ! isset($this->extra_query_vars[$var]) ) 221 $this->query_vars[$var] = $GLOBALS[$var]; 223 222 } 224 223 225 224 if ( isset($error) ) 226 225 $this->query_vars['error'] = $error; 226 227 $this->query_vars = apply_filters('request', $this->query_vars); 227 228 228 229 do_action('parse_request', array(&$this)); … … 273 274 function build_query_string() { 274 275 $this->query_string = ''; 275 276 276 foreach (array_keys($this->query_vars) as $wpvar) { 277 277 if ( '' != $this->query_vars[$wpvar] ) { … … 281 281 } 282 282 283 foreach ($this->private_query_vars as $wpvar) { 284 if (isset($GLOBALS[$wpvar]) && '' != $GLOBALS[$wpvar] && ! isset($this->extra_query_vars[$wpvar]) ) { 285 $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&'; 286 $this->query_string .= $wpvar . '=' . rawurlencode($GLOBALS[$wpvar]); 287 } 288 } 289 290 $this->query_string = apply_filters('query_string', $this->query_string); 283 // query_string filter deprecated. Use request filter instead. 284 global $wp_filter; 285 if ( isset($wp_filter['query_string']) ) { // Don't bother filtering and parsing if no plugins are hooked in. 286 $this->query_string = apply_filters('query_string', $this->query_string); 287 parse_str($this->query_string, $this->query_vars); 288 } 291 289 } 292 290 … … 315 313 function query_posts() { 316 314 $this->build_query_string(); 317 query_posts($this->query_ string);315 query_posts($this->query_vars); 318 316 } 319 317
Note: See TracChangeset
for help on using the changeset viewer.