I’d like to decrease the default RSS cache time for a widget plugin i’ve made that outputs RSS feeds. I’m no php expert, I just copy and paste and understand little bits. I’m using this code to output the RSS
function widget($args, $instance) {
// outputs the content of the widget
extract( $args );
$title = apply_filters('widget_title', $instance['title']);
$tip_language = apply_filters('widget_title', $instance['tip_language']);
echo $before_widget;
echo "<h3 class=\"widgettitle\">" . $title . "</h3>";
include_once(ABSPATH . WPINC . '/rss.php');
$rss_feed = "http://mysite.org/feed";
$rss = fetch_rss($rss_feed);
$rss->items = array_slice($rss->items, 0, 1);
$channel = $rss->channel;
foreach ($rss->items as $item ) {
$parsed_url = parse_url(wp_filter_kses($item['link']));
echo wptexturize($item['description']);
echo "<p><a href="https://wordpress.stackexchange.com/questions/6569/. wp_filter_kses($item["link']) . ">" . wptexturize(wp_specialchars($item['author'])) . "</a></p>";
}
echo $before_after;
}