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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2009-02-27 19:32:50 +00:00
parent b8d8a346d5
commit a02d6e4179
5 changed files with 13886 additions and 150 deletions

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;
}
?>