Created
November 20, 2015 14:48
-
-
Save deepak-rajpal/e9a74d3b0962541f5284 to your computer and use it in GitHub Desktop.
Change WordPress cache feed time from defalut 12 hours to 30 minutes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* By default, WordPress cache feed or rather the cached feed has a lifetime of 43200 seconds, equivalent to 12 hours. */ | |
/* Starts: Change the default feed cache recreation period to 1800 seconds/30 minutes */ | |
function return_cache_recreation( $seconds ) | |
{ | |
return 1800; | |
} | |
add_filter( 'wp_feed_cache_transient_lifetime' , 'return_cache_recreation' ); | |
/* Ends: Change the default feed cache recreation period */ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment