WordPress.org

Make WordPress Core

Ticket #22140: 22140.2.diff

File 22140.2.diff, 1.5 KB (added by JustinSainton, 5 years ago)
  • wp-includes/feed.php

     
    520520 *
    521521 * @since 2.8
    522522 *
    523  * @param string $url URL to retrieve feed
     523 * @param mixed $url URL of feed to retrieve. If an array of URLs, the feeds are merged using SimplePie's multifeed feature.
     524 * See also {@link ​http://simplepie.org/wiki/faq/typical_multifeed_gotchas}
     525 *
    524526 * @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success
    525527 */
    526 function fetch_feed($url) {
    527         require_once (ABSPATH . WPINC . '/class-feed.php');
     528function fetch_feed( $urls ) {
     529        require_once ( ABSPATH . WPINC . '/class-feed.php' );
    528530
    529531        $feed = new SimplePie();
    530532
     
    536538        $feed->set_cache_class( 'WP_Feed_Cache' );
    537539        $feed->set_file_class( 'WP_SimplePie_File' );
    538540
    539         $feed->set_feed_url($url);
    540         $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) );
    541         do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
     541        $feed->set_feed_url( $urls );
     542        $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $urls ) );
     543        do_action_ref_array( 'wp_feed_options', array( &$feed, $urls ) );
    542544        $feed->init();
    543545        $feed->handle_content_type();
    544546
    545547        if ( $feed->error() )
    546                 return new WP_Error('simplepie-error', $feed->error());
     548                return new WP_Error( 'simplepie-error', $feed->error() );
    547549
    548550        return $feed;
    549551}