Make WordPress Core

Changeset 4928


Ignore:
Timestamp:
02/23/2007 08:18:30 AM (19 years ago)
Author:
ryan
Message:

Atom comments feed. First pass. Props kurtmckee and rob1n. fixes #1785

Location:
trunk/wp-includes
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r4927 r4928  
    945945        $feed = preg_replace('/^_+/', '', $feed);
    946946
    947         if ($feed == '' || $feed == 'feed')
     947        if ( $feed == '' || $feed == 'feed' )
    948948        $feed = 'rss2';
    949 
     949       
    950950        $for_comments = false;
    951         if ( 1 != get_query_var('withoutcomments') && ( is_singular() || get_query_var('withcomments') == 1 || $feed == 'comments-rss2' ) ) {
    952                 $feed = 'rss2';
    953                 $for_comments = true;   
    954         }
     951
     952        if ( is_singular() || get_query_var('withcomments') == 1 )
     953                $for_comments = true;
     954
     955         if ( false !== strpos($feed, 'comments-') ) {
     956                $for_comments = true;
     957                $feed = str_replace('comments-', '', $feed);
     958         }
     959
     960         if ( get_query_var('withoutcomments') == 1 )
     961                $for_comments = false;
    955962
    956963        $hook = 'do_feed_' . $feed;
     
    974981}
    975982
    976 function do_feed_atom() {
    977         load_template(ABSPATH . WPINC . '/feed-atom.php');
     983function do_feed_atom($for_comments) {
     984        if ($for_comments) {
     985                load_template(ABSPATH . WPINC . '/feed-atom-comments.php');
     986        } else {
     987                load_template(ABSPATH . WPINC . '/feed-atom.php');
     988        }
    978989}
    979990
  • trunk/wp-includes/general-template.php

    r4924 r4928  
    100100                        $output = get_feed_link('atom');
    101101                        break;
     102                case 'comments_atom_url':
     103                        $output = get_feed_link('comments_atom');
    102104                case 'comments_rss2_url':
    103105                        $output = get_feed_link('comments_rss2');
Note: See TracChangeset for help on using the changeset viewer.