epl_listing_query_cache_expiration: how long listing search results are cached

Description #

How long, in seconds, EPL keeps a saved listing search result before it runs the query again. The default is 12 hours. Results refresh sooner by themselves when a listing changes, so you rarely need this. See How the listing search cache works.


Usage #

add_filter( 'epl_listing_query_cache_expiration', 'my_function' );

Parameters #

$expiration (int)
Seconds to keep each result. Default 12 * HOUR_IN_SECONDS (43200).


Examples #

Keep results for a day:

function my_epl_search_cache_expiration( $expiration ) {
	return DAY_IN_SECONDS;
}
add_filter( 'epl_listing_query_cache_expiration', 'my_epl_search_cache_expiration' );

The time applies to results saved during a page load and to results saved by the background rebuild. Don't return 0: WordPress keeps a transient with no expiry time forever and loads it on every page.


Source #

lib/includes/functions.php, in epl_listing_query_cache_expiration(), used by epl_listing_query_cache() and epl_rebuild_listing_query_cache(). Since 3.6.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.