mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
phpdoc for fetch_feed(). Props rmmcue. see #9198
git-svn-id: https://develop.svn.wordpress.org/trunk@10671 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -534,6 +534,14 @@ function feed_content_type( $type = '' ) {
|
||||
return apply_filters( 'feed_content_type', $content_type, $type );
|
||||
}
|
||||
|
||||
/**
|
||||
* Build SimplePie object based on RSS or Atom feed from URL.
|
||||
*
|
||||
* @since 2.8
|
||||
*
|
||||
* @param string $url URL to retrieve feed
|
||||
* @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success
|
||||
*/
|
||||
function fetch_feed($url) {
|
||||
require_once (ABSPATH . WPINC . '/class-feed.php');
|
||||
|
||||
@@ -545,6 +553,9 @@ function fetch_feed($url) {
|
||||
$feed->init();
|
||||
$feed->handle_content_type();
|
||||
|
||||
if ( $feed->error() )
|
||||
return new WP_Error('simplepie-error', $feed->error());
|
||||
|
||||
return $feed;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user