rss文件更新后如何强制刷新?无论如何,它似乎都在缓存...
提要位于 WordPress 仪表板小部件中,使用 simplepie fetch_feed() 方法...
/* Dashboard Widget */
function my_dashboard_widget_function() {
$rss = fetch_feed( "http://mysite.com/feed.rss" );
if ( is_wp_error($rss) ) {
if ( is_admin() || current_user_can('manage_options') ) {
echo '<p>';
printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
echo '</p>';
}
return;
}