soundcloud_iframe_widget

Iframe widget embed code.

Description

({string}) soundcloud_iframe_widget( ({array}) $options ); 

Returns ({string})

Iframe embed code

Parameters (1)

0. $options ({array})
The options.

Usage

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

Defined (1)

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

/modules/shortcodes/soundcloud.php  
  1. function soundcloud_iframe_widget( $options ) { 
  2.  
  3. // Build URL 
  4. $url = set_url_scheme( 'https://w.soundcloud.com/player/?' . http_build_query( $options['params'] ) ); 
  5. // Set default width if not defined 
  6. $width = isset($options['width']) && $options['width'] !== 0 ? $options['width'] : '100%'; 
  7. // Set default height if not defined 
  8. $height = isset($options['height']) && $options['height'] !== 0 
  9. ? $options['height'] 
  10. : ( soundcloud_url_has_tracklist( $options['url']) || ( isset( $options['params']['visual'] ) && soundcloud_booleanize( $options['params']['visual'] ) ) ? '450' : '166'); 
  11.  
  12. return sprintf( '<iframe width="%s" height="%s" scrolling="no" frameborder="no" src="%s"></iframe>', $width, $height, $url );