Make WordPress Core

Ticket #4595: rss-patch.txt

File rss-patch.txt, 2.6 KB (added by terraces, 18 years ago)
Line 
1Index: wp-includes/feed.php
2===================================================================
3--- wp-includes/feed.php        (révision 5789)
4+++ wp-includes/feed.php        (copie de travail)
5@@ -206,4 +206,19 @@
6        }
7 }
8 
9-?>
10\ Pas de fin de ligne à la fin du fichier
11+function wp_dropdown_feeds ( $default = "rss2" ) {
12+       $feeds = array ('rss' => 'RSS 0.92',
13+                       'rss2' => 'RSS 2.0',
14+                       'rdf' => 'RSS 1.0',
15+                       'atom' => 'Atom');
16+       $r = '';
17+       foreach( $feeds as $feed => $name)
18+               if ( $default == $feed ) // Make default first in list
19+                       $p = "\n\t<option selected='selected' value='$feed'>$name</option>";
20+               else
21+                       $r .= "\n\t<option value='$feed'>$name</option>";
22+       echo $p . $r;
23+
24+}
25+
26+?>
27Index: wp-includes/functions.php
28===================================================================
29--- wp-includes/functions.php   (révision 5789)
30+++ wp-includes/functions.php   (copie de travail)
31@@ -769,7 +769,7 @@
32        $feed = preg_replace('/^_+/', '', $feed);
33 
34        if ( $feed == '' || $feed == 'feed' )
35-               $feed = 'rss2';
36+               $feed = get_option('rss_format');
37 
38        $hook = 'do_feed_' . $feed;
39        do_action($hook, $wp_query->is_comment_feed);
40Index: wp-admin/options-reading.php
41===================================================================
42--- wp-admin/options-reading.php        (révision 5789)
43+++ wp-admin/options-reading.php        (copie de travail)
44@@ -62,6 +62,10 @@
45 <legend><?php _e('Syndication Feeds') ?></legend>
46 <table width="100%" cellspacing="2" cellpadding="5" class="optiontable editform">
47 <tr valign="top">
48+<th width="33%" scope="row"><?php _e('Feed format:') ?></th>
49+<td><select name="rss_format"><?php wp_dropdown_feeds( get_option('rss_format')); ?></select></td>
50+</tr>
51+<tr valign="top">
52 <th width="33%" scope="row"><?php _e('Show the most recent:') ?></th>
53 <td><input name="posts_per_rss" type="text" id="posts_per_rss" value="<?php form_option('posts_per_rss'); ?>" size="3" /> <?php _e('posts') ?></td>
54 </tr>
55@@ -88,9 +92,9 @@
56 </p>
57 <p class="submit">
58 <input type="hidden" name="action" value="update" />
59-<input type="hidden" name="page_options" value="posts_per_page,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" />
60+<input type="hidden" name="page_options" value="posts_per_page,rss_format,posts_per_rss,rss_use_excerpt,blog_charset,gzipcompression,show_on_front,page_on_front,page_for_posts" />
61 <input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
62 </p>
63 </form>
64 </div>
65-<?php include('./admin-footer.php'); ?>
66\ Pas de fin de ligne à la fin du fichier
67+<?php include('./admin-footer.php'); ?>