[wp-trac] [WordPress Trac] #4619: add_feed does not generate rewrite rules

WordPress Trac wp-trac at lists.automattic.com
Wed Jul 11 21:18:54 GMT 2007


#4619: add_feed does not generate rewrite rules
----------------------------+-----------------------------------------------
 Reporter:  cavemonkey50    |       Owner:  anonymous
     Type:  defect          |      Status:  new      
 Priority:  normal          |   Milestone:           
Component:  Administration  |     Version:  2.2.1    
 Severity:  normal          |    Keywords:           
----------------------------+-----------------------------------------------
 When using the function add_feed to add a new feed type, the function is
 supposed to generate the correct rewrite rules to make the feed type
 functional. However, this does not occur in the function.

 Lines 30-32 of includes/rewrite.php are supposed to handle adding the feed
 type to the array of feeds:

 {{{
 if (!in_array($feedname, $wp_rewrite->feeds)) { //override the file if it
 is
         $wp_rewrite->feeds[] = $feedname;
 }
 }}}

 However, when add_feed calls the array, the array is empty because the
 $wp_rewrite class has not yet been executed. Therefore, the check to see
 if the feed name already exists is pointless. Even though $wp_rewrite
 class has not been run, $wp-rewrite->feeds gets populated with the new
 feed names, which then could be added to the array later.

 Although, adding the new feed names to the array never occurs. Line 229
 then defines feed names, completely ignoring the previously added feed
 names.

 {{{
 var $feeds = array ( 'feed', 'rdf', 'rss', 'rss2', 'atom' );
 }}}

 So basically, the feed names never get added to the feeds array, therefore
 never having the correct rewrite rules generated.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4619>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list