Changeset 4205 for trunk/wp-includes/query.php
- Timestamp:
- 09/21/2006 09:05:38 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r4186 r4205 330 330 $this->parse_query(''); 331 331 } 332 333 function fill_query_vars($array) { 334 $keys = array( 335 'error' 336 , 'm' 337 , 'p' 338 , 'subpost' 339 , 'subpost_id' 340 , 'attachment' 341 , 'attachment_id' 342 , 'name' 343 , 'hour' 344 , 'static' 345 , 'pagename' 346 , 'page_id' 347 , 'second' 348 , 'minute' 349 , 'hour' 350 , 'day' 351 , 'monthnum' 352 , 'year' 353 , 'w' 354 , 'category_name' 355 , 'author_name' 356 , 'feed' 357 , 'tb' 358 , 'paged' 359 , 'comments_popup' 360 , 'preview' 361 ); 362 363 foreach ($keys as $key) { 364 if ( !isset($array[$key])) 365 $array[$key] = ''; 366 } 367 368 return $array; 369 } 332 370 333 371 // Parse a query string and set query type booleans. … … 342 380 $this->query_vars = $qv; 343 381 } 344 382 383 $qv = $this->fill_query_vars($qv); 384 345 385 if ( ! empty($qv['robots']) ) { 346 386 $this->is_robots = true; … … 531 571 // Shorthand. 532 572 $q = &$this->query_vars; 573 574 $q = $this->fill_query_vars($q); 533 575 534 576 // First let's clear some variables … … 541 583 $limits = ''; 542 584 $join = ''; 585 $search = ''; 543 586 544 587 if ( !isset($q['post_type']) ) … … 910 953 911 954 if (($q['what_to_show'] == 'posts')) { 912 $q['offset'] = abs(intval($q['offset']));913 955 if ( empty($q['offset']) ) { 914 956 $pgstrt = ''; … … 916 958 $limits = 'LIMIT '.$pgstrt.$q['posts_per_page']; 917 959 } else { // we're ignoring $page and using 'offset' 960 $q['offset'] = abs(intval($q['offset'])); 918 961 $pgstrt = $q['offset'] . ', '; 919 962 $limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
Note: See TracChangeset
for help on using the changeset viewer.