Use SimplePie for widget and dashboard feeds. First cut. see #9198

git-svn-id: https://develop.svn.wordpress.org/trunk@10666 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-02-27 19:32:50 +00:00
parent 8bab50a649
commit 7062db47c2
5 changed files with 13886 additions and 150 deletions
+14
View File
@@ -534,4 +534,18 @@ function feed_content_type( $type = '' ) {
return apply_filters( 'feed_content_type', $content_type, $type );
}
function fetch_feed($url) {
require_once (ABSPATH . WPINC . '/class-feed.php');
$feed = new SimplePie();
$feed->set_feed_url($url);
$feed->set_cache_class('WP_Feed_Cache');
$feed->set_cache_duration(43200);
$feed->set_useragent('WordPress/' . $GLOBALS['wp_version']);
$feed->init();
$feed->handle_content_type();
return $feed;
}
?>