]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/post.php
Wordpress 3.1.1
[autoinstalls/wordpress.git] / wp-includes / post.php
index 0acf6414e7aebfd9e32725223db09b3f7c180490..191b42c5d211e7c045bbe294086b2688532ac0c0 100644 (file)
@@ -985,6 +985,11 @@ 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;
+                       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 ) {
                                $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
@@ -5236,4 +5241,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
+?>