WordPress.org

Make WordPress Core

Changeset 24054


Ignore:
Timestamp:
04/22/13 20:24:41 (2 years ago)
Author:
nacin
Message:

Document that fetch_feed() can accept multiple URLs, thus leveraging SimplePie's multifeed feature. props JustinSainton, fixes #22140.

File:
1 edited

Legend:

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

    r23624 r24054  
    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 
     524 * using SimplePie's multifeed feature. 
     525 * See also {@link ​http://simplepie.org/wiki/faq/typical_multifeed_gotchas} 
     526 * 
    524527 * @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success 
    525528 */ 
    526 function fetch_feed($url) { 
    527     require_once (ABSPATH . WPINC . '/class-feed.php'); 
     529function fetch_feed( $url ) { 
     530    require_once ( ABSPATH . WPINC . '/class-feed.php' ); 
    528531 
    529532    $feed = new SimplePie(); 
     
    537540    $feed->set_file_class( 'WP_SimplePie_File' ); 
    538541 
    539     $feed->set_feed_url($url); 
     542    $feed->set_feed_url( $url ); 
    540543    $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) ); 
    541544    do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); 
     
    544547 
    545548    if ( $feed->error() ) 
    546         return new WP_Error('simplepie-error', $feed->error()); 
     549        return new WP_Error( 'simplepie-error', $feed->error() ); 
    547550 
    548551    return $feed; 
Note: See TracChangeset for help on using the changeset viewer.