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.

git-svn-id: https://develop.svn.wordpress.org/trunk@15936 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-10-23 18:29:22 +00:00
parent 4d0164db91
commit 6d7366d5fc
2 changed files with 11 additions and 11 deletions

View File

@@ -1334,7 +1334,7 @@ class WP_Query extends WP_Object_Query {
if ( !empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {
$post_type_obj = get_post_type_object( $qv['post_type'] );
if ( is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['archive'] )
if ( $post_type_obj->has_archive )
$this->is_post_type_archive = true;
}