blip_embed_to_shortcode

Blip.tv embed code:Blip.tv shortcode is: [blip.tv url-or-something-else].

Description

blip_embed_to_shortcode( $content ); 

Parameters (1)

0. $content
The content.

Usage

  1. if ( !function_exists( 'blip_embed_to_shortcode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/shortcodes/blip.php'; 
  3.  
  4. // The content. 
  5. $content = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = blip_embed_to_shortcode($content); 
  9.  

Defined (1)

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

/modules/shortcodes/blip.php  
  1. function blip_embed_to_shortcode( $content ) { 
  2. if ( false === stripos( $content, '/blip.tv/play/' ) ) 
  3. return $content; 
  4.  
  5. $regexp = '!<embed((?:\s+\w+="[^"]*")*)\s+src="http(?:\:|�*58;)//(blip\.tv/play/[^"]*)"((?:\s+\w+="[^"]*")*)\s*(?:/>|>\s*</embed>)!'; 
  6. $regexp_ent = str_replace( '&#0*58;', '&#0*58;|�*58;', htmlspecialchars( $regexp, ENT_NOQUOTES ) ); 
  7.  
  8. foreach ( array( 'regexp', 'regexp_ent' ) as $reg ) { 
  9. if ( !preg_match_all( $$reg, $content, $matches, PREG_SET_ORDER ) ) 
  10. continue; 
  11.  
  12. foreach ( $matches as $match ) { 
  13. $src = 'http://' . html_entity_decode( $match[2] ); 
  14. $params = $match[1] . $match[3]; 
  15. if ( 'regexp_ent' == $reg ) { 
  16. $src = html_entity_decode( $src ); 
  17. $params = html_entity_decode( $params ); 
  18. $params = wp_kses_hair( $params, array( 'http' ) ); 
  19. if ( ! isset( $params['type'] ) || 'application/x-shockwave-flash' != $params['type']['value'] ) 
  20. continue; 
  21.  
  22. $content = str_replace( $match[0], "[blip.tv $src]", $content ); 
  23. return $content;