Skip to content

Commit

Permalink
Fix feed links when using %category% permalink structure. Props westi…
Browse files Browse the repository at this point in the history
…. fixes #3214

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
markjaquith committed Jan 30, 2007
1 parent 8cc590e commit 292f9e9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion wp-includes/classes.php
Expand Up @@ -1319,6 +1319,14 @@ function rewrite_rules() {
if (empty($this->permalink_structure)) {
return $rewrite;
}
//Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category%
$default_feeds = array( 'wp-atom.php$' => $this->index .'?feed=atom',
'wp-rdf.php$' => $this->index .'?feed=rdf',
'wp-rss.php$' => $this->index .'?feed=rss',
'wp-rss2.php$' => $this->index .'?feed=rss2',
'wp-feed.php$' => $this->index .'?feed=feed',
'wp-commentsrss2.php$' => $this->index . '?feed=rss2&withcomments=1');


// Post
$post_rewrite = $this->generate_rewrite_rules($this->permalink_structure);
Expand Down Expand Up @@ -1354,7 +1362,7 @@ function rewrite_rules() {
$page_rewrite = apply_filters('page_rewrite_rules', $page_rewrite);

// Put them together.
$this->rules = array_merge($page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite);
$this->rules = array_merge($default_feeds, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $author_rewrite, $date_rewrite, $post_rewrite);

do_action('generate_rewrite_rules', array(&$this));
$this->rules = apply_filters('rewrite_rules_array', $this->rules);
Expand Down

0 comments on commit 292f9e9

Please sign in to comment.