edd_add_cache_busting

Adds the 'nocache' parameter to the provided URL.

Description

(string) edd_add_cache_busting( (string) $url = '' ); 

Returns (string)

The URL with cache busting added or not

Parameters (1)

0. $url — Optional. (string) => ''
The URL being requested

Usage

  1. if ( !function_exists( 'edd_add_cache_busting' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'easy-digital-downloads/includes/misc-functions.php'; 
  3.  
  4. // The URL being requested 
  5. $url = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = edd_add_cache_busting($url); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/misc-functions.php  
  1. function edd_add_cache_busting( $url = '' ) { 
  2.  
  3. $no_cache_checkout = edd_get_option( 'no_cache_checkout', false ); 
  4.  
  5. if ( edd_is_caching_plugin_active() || ( edd_is_checkout() && $no_cache_checkout ) ) { 
  6. $url = add_query_arg( 'nocache', 'true', $url ); 
  7.  
  8. return $url;