Make WordPress Core

Ticket #24867: 24867.diff

File 24867.diff, 1.1 KB (added by marcosf, 11 years ago)
  • post.php

     
    12391239                        $args->rewrite['with_front'] = true;
    12401240                if ( ! isset( $args->rewrite['pages'] ) )
    12411241                        $args->rewrite['pages'] = true;
    1242                 if ( ! isset( $args->rewrite['feeds'] ) || ! $args->has_archive )
     1242                if ( ! isset( $args->rewrite['feeds'] ) )
    12431243                        $args->rewrite['feeds'] = (bool) $args->has_archive;
    12441244                if ( ! isset( $args->rewrite['ep_mask'] ) ) {
    12451245                        if ( isset( $args->permalink_epmask ) )
     
    12611261                                $archive_slug = $wp_rewrite->root . $archive_slug;
    12621262
    12631263                        add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
    1264                         if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {
     1264                        if ( $args->has_archive && $args->rewrite['feeds'] && $wp_rewrite->feeds ) {
    12651265                                $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
    12661266                                add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
    12671267                                add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );