Ticket #26560: 26560.2.patch
File 26560.2.patch, 1.7 KB (added by , 10 years ago) |
---|
-
wp-includes/rss.php
886 886 } 887 887 888 888 foreach ( (array) $rss->items as $item ) { 889 printf(890 '<li><a href="%1$s" title="%2$s">%3$s</a></li>',889 $item_output = sprintf( 890 '<li><a href="%1$s">%2$s</a></li>', 891 891 esc_url( $item['link'] ), 892 esc_attr( strip_tags( $item['description'] ) ),893 892 esc_html( $item['title'] ) 894 893 ); 894 895 /** 896 * Filter the output of individual RSS items. 897 * 898 * Provides an opportunity to customize the output of RSS items, 899 * so the descriptions can be shown in a more accessible way. 900 * 901 * @since 4.2.0 902 * 903 * @param string $item_output Rendered output of an individual RSS item. 904 * @param array $item Parsed RSS item. 905 */ 906 echo apply_filters( 'rss_item_output', $item_output, $item ); 895 907 } 896 908 897 909 echo '</ul>'; … … 921 933 function get_rss ($url, $num_items = 5) { // Like get posts, but for RSS 922 934 $rss = fetch_rss($url); 923 935 if ( $rss ) { 924 $rss->items = array_slice( $rss->items, 0, $num_items);936 $rss->items = array_slice( $rss->items, 0, $num_items ); 925 937 foreach ( (array) $rss->items as $item ) { 926 echo "<li>\n"; 927 echo "<a href='$item[link]' title='$item[description]'>"; 928 echo esc_html($item['title']); 929 echo "</a><br />\n"; 930 echo "</li>\n"; 938 $item_output = sprintf( 939 '<li><a href="%1$s">%2$s</a></li>', 940 esc_url( $item['link'] ), 941 esc_html( $item['title'] ) 942 ); 943 944 /** This filter is documented in wp-includes/rss.php */ 945 echo apply_filters( 'rss_item_output', $item_output, $item ); 931 946 } 932 947 } else { 933 948 return false;