Correctly handle PATHINFO CPTs and CTs that specify with_front=false. fixes #16807 for trunk

git-svn-id: https://develop.svn.wordpress.org/trunk@17518 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2011-03-10 04:24:48 +00:00
parent d79937e6a3
commit 0984bae175
4 changed files with 7 additions and 1 deletions

View File

@@ -987,6 +987,8 @@ function register_post_type($post_type, $args = array()) {
$archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
if ( $args->rewrite['with_front'] )
$archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;
else
$archive_slug = $wp_rewrite->root . $archive_slug;
$wp_rewrite->add_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {