mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user