WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/23/2010 06:29:22 PM (9 years ago)
Author:
nacin
Message:

Move the CPT archive flag outside of the rewrite argument, into its own has_archive. has_archive controls more than just URL rewriting, it also handles whether ?post_type= is treated as a CPT archive. feeds remain in rewrite as ?feed= would work regardless. see #13818.

File:
1 edited

Legend:

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

    r15935 r15936  
    13351335            if ( !empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {
    13361336                $post_type_obj = get_post_type_object( $qv['post_type'] );
    1337                 if ( is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['archive'] )
     1337                if ( $post_type_obj->has_archive )
    13381338                    $this->is_post_type_archive = true;
    13391339            }
Note: See TracChangeset for help on using the changeset viewer.