Use with_front properly when creating rules for CPT archive pages. props scribu. fixes #16626 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@17514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2011-03-09 05:40:52 +00:00
parent afdda66384
commit 1a7a1d9986

View File

@ -985,6 +985,9 @@ function register_post_type($post_type, $args = array()) {
if ( $args->has_archive ) {
$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;
$wp_rewrite->add_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {
$feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
@ -5236,4 +5239,4 @@ function _post_format_wp_get_object_terms( $terms ) {
}
add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' );
?>
?>