From 1a7a1d9986f7bf584e1906d866e35380a4e9a385 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 9 Mar 2011 05:40:52 +0000 Subject: [PATCH] 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 --- wp-includes/post.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 0acf6414e..8b8014680 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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' ); -?> \ No newline at end of file +?>