Run a listing query, with its result cached across page loads
For queries whose results only change when listings change, such as the values in the search dropdowns. The result is remembered for the rest of the page load and saved as a transient for 12 hours (filter epl_listing_query_cache_expiration).
When listings change, visitors keep getting the cached results while a background job (WP-Cron) rebuilds every query visitors have used, then the site switches to the new results, so no visitor waits for the rebuild. If the rebuild hasn't run within 10 minutes (filter epl_listing_query_cache_stale_limit), the next page load rebuilds as it goes.
| Since | |
|---|---|
3.6 |
|
| Parameters | |||
|---|---|---|---|
string
|
$sql |
A prepared SQL query. |
# |
string
|
$return_type = 'col' |
col for $wpdb->get_col(), results for $wpdb->get_results(). |
# |
| Returns | |
|---|---|
array
|
|