Fetch_Feed cache time
-
Please update Fetch_Feed to support an optional parameter for the cache time value.
I know that I can change the global time using the wp_feed_cache_transient_lifetime filter, but I need the ability to set individual cache times. Some feeds I want to update more quickly than others.
In my testing, I modified fetch_feed with the following:
function fetch_feed( $url, $cache_time = NULL ) ... if ($cache_time == NULL) { $cache_time = apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ); } ... $feed->set_cache_duration( $cache_time );
which doesn’t break existing calls, but allows me to set individual cache times for feeds.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Fetch_Feed cache time’ is closed to new replies.