Advertisement
ridgey28

WP SimplePie Change Feed Cache Time

Dec 12th, 2013
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. /*Change the cache time of the WP simplepie from the default 12 hours */
  2. function cache_time($seconds)
  3. {
  4.     // change the default feed cache recreation period to 1 hour
  5.     return 3600;
  6. }
  7. add_filter( 'wp_feed_cache_transient_lifetime' , 'cache_time' );
  8.  
  9.  
  10. /****  
  11. Rest of script starts here:
  12. Visit http://www.worldoweb.co.uk/2012/display-wordpress-posts-on-another-wp-blog
  13. ****/
  14. $rss = fetch_feed('http://www.worldoweb.co.uk/feed');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement