Make WordPress Core

Ticket #4547: 4547.diff

File 4547.diff, 1.2 KB (added by Otto42, 16 years ago)

Allows a plugin to not load Magpie at all, thus allowing for true replacement.

  • wp-includes/rss.php

     
    99 * License:             GPL
    1010 */
    1111
     12if ( defined('SKIP_MAGPIE') ) {
     13
    1214define('RSS', 'RSS');
    1315define('ATOM', 'Atom');
    1416define('MAGPIE_USER_AGENT', 'WordPress/' . $wp_version);
     
    825827function wp_rss( $url, $num_items = -1 ) {
    826828        if ( $rss = fetch_rss( $url ) ) {
    827829                echo '<ul>';
    828                
     830
    829831                if ( $num_items !== -1 ) {
    830832                        $rss->items = array_slice( $rss->items, 0, $num_items );
    831833                }
    832                
     834
    833835                foreach ( $rss->items as $item ) {
    834836                        printf(
    835                                 '<li><a href="%1$s" title="%2$s">%3$s</a></li>', 
    836                                 clean_url( $item['link'] ), 
    837                                 attribute_escape( strip_tags( $item['description'] ) ), 
     837                                '<li><a href="%1$s" title="%2$s">%3$s</a></li>',
     838                                clean_url( $item['link'] ),
     839                                attribute_escape( strip_tags( $item['description'] ) ),
    838840                                htmlentities( $item['title'] )
    839841                        );
    840842                }
    841                
     843
    842844                echo '</ul>';
    843845        } else {
    844846                _e( 'An error has occurred, which probably means the feed is down. Try again later.' );
     
    864866}
    865867endif;
    866868
     869}
     870
    867871?>
     872 No newline at end of file