以上程式碼失效 ,create_function 會提示函式已棄用,現在可以使用下面的程式碼:
//更新 rss 頻率
function return_3600( $seconds ) {
// change the default feed cache recreation period to 1 hours
return 3600;
}
add_filter( 'wp_feed_cache_transient_lifetime' , 'return_3600' );
如果不是很頻繁的話,可以設定為 7200 這樣兩小時更新一次,我們自己站的設定為 3600 ,每小時更新。