Make WordPress Core


Ignore:
Timestamp:
12/13/2005 07:19:56 PM (20 years ago)
Author:
ryan
Message:

Attachment enhancements from skeltoac. fixes #2074

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r3300 r3303  
    9898            $qv['attachment_id'] = $qv['subpost_id'];
    9999           
    100         if ( ('' != $qv['attachment']) || $qv['attachment_id'] ) {
     100        if ( ('' != $qv['attachment']) || (int) $qv['attachment_id'] ) {
    101101            $this->is_single = true;
    102102            $this->is_attachment = true;
    103         }
    104 
    105         if ('' != $qv['name']) {
     103        } elseif ('' != $qv['name']) {
    106104            $this->is_single = true;
    107105        } elseif ( $qv['p'] ) {
     
    116114        } elseif (!empty($qv['s'])) {
    117115            $this->is_search = true;
     116            switch ($qv['show_post_type']) {
     117            case 'page' :
     118                $this->is_page = true;
     119                break;
     120            case 'attachment' :
     121                $this->is_attachment = true;
     122                break;
     123            }
    118124        } else {
    119125        // Look for archive queries.  Dates, categories, authors.
     
    198204            if ( ($this->is_date || $this->is_author || $this->is_category)) {
    199205                $this->is_archive = true;
     206            }
     207
     208            if ( 'attachment' == $qv['show_post_type'] ) {
     209                $this->is_attachment = true;
    200210            }
    201211        }
     
    14141424    var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id');
    14151425
    1416     var $private_query_vars = array('posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging');
     1426    var $private_query_vars = array('posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'show_post_type');
    14171427
    14181428    var $query_vars;
Note: See TracChangeset for help on using the changeset viewer.