jetpack_responsive_videos_embed_html

Adds a wrapper to videos and enqueue script.

Description

(string) jetpack_responsive_videos_embed_html( $html ); 

Returns (string)

Parameters (1)

0. $html
The html.

Usage

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

Defined (1)

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

/modules/theme-tools/responsive-videos.php  
  1. function jetpack_responsive_videos_embed_html( $html ) { 
  2. if ( empty( $html ) || ! is_string( $html ) ) { 
  3. return $html; 
  4.  
  5. if ( defined( 'SCRIPT_DEBUG' ) && true == SCRIPT_DEBUG ) { 
  6. wp_enqueue_script( 'jetpack-responsive-videos-script', plugins_url( 'responsive-videos/responsive-videos.js', __FILE__ ), array( 'jquery' ), '1.1', true ); 
  7. } else { 
  8. wp_enqueue_script( 'jetpack-responsive-videos-min-script', plugins_url( 'responsive-videos/responsive-videos.min.js', __FILE__ ), array( 'jquery' ), '1.1', true ); 
  9.  
  10. // Enqueue CSS to ensure compatibility with all themes 
  11. wp_register_style( 'jetpack-responsive-videos-style', plugins_url( 'responsive-videos/responsive-videos.css', __FILE__ ) ); 
  12. wp_enqueue_style( 'jetpack-responsive-videos-style' ); 
  13.  
  14. return '<div class="jetpack-video-wrapper">' . $html . '</div>';