Changeset 1728 for trunk/wp-includes/classes.php
- Timestamp:
- 10/02/2004 07:24:40 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r1714 r1728 4 4 var $query; 5 5 var $query_vars; 6 var $queried_object; 7 var $queried_object_id; 6 8 7 9 var $posts; … … 44 46 unset($this->query); 45 47 unset($this->query_vars); 48 unset($this->queried_object); 49 unset($this->queried_object_id); 46 50 $this->post_count = 0; 47 51 $this->current_post = -1; … … 523 527 $this->post_count = count($this->posts); 524 528 if ($this->post_count > 0) { 525 $this->post = $ posts[0];529 $this->post = $this->posts[0]; 526 530 } 527 531 … … 552 556 $this->parse_query($query); 553 557 return $this->get_posts(); 558 } 559 560 function get_queried_object() { 561 if (isset($this->queried_object)) { 562 return $this->queried_object; 563 } 564 565 $this->queried_object = NULL; 566 $this->queried_object_id = 0; 567 568 if ($this->is_category) { 569 global $cache_categories; 570 if (isset($cache_categories[$this->get('cat')])) { 571 $this->queried_object = $cache_categories[$this->get('cat')]; 572 $this->queried_object_id = $this->get('cat'); 573 } 574 } else if ($this->is_single) { 575 $this->queried_object = $this->post; 576 $this->queried_object_id = $this->post->ID; 577 } else if ($this->is_page) { 578 $this->queried_object = $this->post; 579 $this->queried_object_id = $this->post->ID; 580 } else if ($this->is_author) { 581 global $cache_userdata; 582 if (isset($cache_userdata[$this->get('author')])) { 583 $this->queried_object = $cache_userdata[$this->get('author')]; 584 $this->queried_object_id = $this->get('author'); 585 } 586 } 587 588 return $this->queried_object; 589 } 590 591 function get_queried_object_id() { 592 $this->get_queried_object(); 593 594 if (isset($this->queried_object_id)) { 595 return $this->queried_object_id; 596 } 597 598 return 0; 554 599 } 555 600
Note: See TracChangeset
for help on using the changeset viewer.