Ticket #16415: 16415.diff
File 16415.diff, 2.1 KB (added by , 14 years ago) |
---|
-
wp-includes/post.php
972 972 $args->rewrite['with_front'] = true; 973 973 if ( ! isset( $args->rewrite['pages'] ) ) 974 974 $args->rewrite['pages'] = true; 975 if ( ! isset( $args->rewrite['feeds'] ) || ! $args->has_archive)975 if ( ! isset( $args->rewrite['feeds'] ) && isset( $args->has_archive ) ) 976 976 $args->rewrite['feeds'] = (bool) $args->has_archive; 977 977 978 978 if ( $args->hierarchical ) … … 980 980 else 981 981 $wp_rewrite->add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 982 982 983 $archive_slug = ( is_string( $args->has_archive ) && strlen( $args->has_archive ) ) ? $args->has_archive : $args->rewrite['slug']; 984 if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) { 985 $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')'; 986 $wp_rewrite->add_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 987 $wp_rewrite->add_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 988 } 983 989 if ( $args->has_archive ) { 984 $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;985 990 $wp_rewrite->add_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' ); 986 if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {987 $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';988 $wp_rewrite->add_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );989 $wp_rewrite->add_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );990 }991 991 if ( $args->rewrite['pages'] ) 992 992 $wp_rewrite->add_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' ); 993 993 } … … 5235 5235 } 5236 5236 add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); 5237 5237 5238 ?> 5239 No newline at end of file 5238 ?>