jetpack_flickr_oembed_handler

The Jetpack by WordPress.com jetpack flickr oembed handler function.

Description

jetpack_flickr_oembed_handler( $matches, $attr, $url ); 

Parameters (3)

0. $matches
The matches.
1. $attr
The attr.
2. $url
The url.

Usage

  1. if ( !function_exists( 'jetpack_flickr_oembed_handler' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/shortcodes/flickr.php'; 
  3.  
  4. // The matches. 
  5. $matches = null; 
  6.  
  7. // The attr. 
  8. $attr = null; 
  9.  
  10. // The url. 
  11. $url = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = jetpack_flickr_oembed_handler($matches, $attr, $url); 
  15.  

Defined (1)

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

/modules/shortcodes/flickr.php  
  1. function jetpack_flickr_oembed_handler( $matches, $attr, $url ) { 
  2. // Legacy slideshow embeds end with /show/ 
  3. // e.g. http://www.flickr.com/photos/yarnaholic/sets/72157615194738969/show/ 
  4. if ( '/show/' !== substr( $url, -strlen( '/show/' ) ) ) { 
  5. // These lookups need cached, as they don't use WP_Embed (which caches) 
  6. $cache_key = md5( $url . serialize( $attr ) ); 
  7. $cache_group = 'oembed_flickr'; 
  8.  
  9. $html = wp_cache_get( $cache_key, $cache_group ); 
  10.  
  11. if ( false === $html ) { 
  12. $html = _wp_oembed_get_object()->get_html( $url, $attr ); 
  13.  
  14. wp_cache_set( $cache_key, $html, $cache_group, 60 * MINUTE_IN_SECONDS ); 
  15.  
  16. return $html; 
  17.  
  18. return flickr_shortcode_handler( array( 'photo' => $url ) );