instagram_cache_oembed_api_response_body

Filter Object Caching for response from Instagram.

Description

apply_filters( 'instagram_cache_oembed_api_response_body', (bool) $false, (array) $matches, (array) $atts, (string) $passed_url ); 

Allow enabling of object caching for the response sent by Instagram when querying for Instagram image HTML.

Parameters (4)

0. $false (bool)
False Object caching is off by default.
1. $matches (array)
Array of Instagram URLs found in the post.
2. $atts (array)
Instagram Shortcode attributes.
3. $passed_url (string)
Instagram API URL.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'instagram_cache_oembed_api_response_body', $false, $matches, $atts, $passed_url ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the instagram_cache_oembed_api_response_body callback 
  2. function filter_instagram_cache_oembed_api_response_body( $false, $matches, $atts, $passed_url ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'instagram_cache_oembed_api_response_body', 'filter_instagram_cache_oembed_api_response_body', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'instagram_cache_oembed_api_response_body', 'filter_instagram_cache_oembed_api_response_body', 10, 4 ); 

Defined (1)

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

/modules/shortcodes/instagram.php  
  1. $response_body_use_cache = apply_filters( 'instagram_cache_oembed_api_response_body', false, $matches, $atts, $passed_url );