soundcloud_flash_widget

Legacy Flash widget embed code.

Description

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

Returns ({string})

Flash embed code

Parameters (1)

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

Usage

  1. if ( !function_exists( 'soundcloud_flash_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_flash_widget($options); 
  9.  

Defined (1)

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

/modules/shortcodes/soundcloud.php  
  1. function soundcloud_flash_widget( $options ) { 
  2.  
  3. // Build URL 
  4. $url = set_url_scheme( 'https://player.soundcloud.com/player.swf?' . 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 ? $options['height'] : ( soundcloud_url_has_tracklist( $options['url'] ) ? '255' : '81'); 
  9.  
  10. return preg_replace( '/\s\s+/', "", sprintf( '<object width="%s" height="%s"> 
  11. <param name="movie" value="%s"></param> 
  12. <param name="allowscriptaccess" value="always"></param> 
  13. <embed width="%s" height="%s" src="%s" allowscriptaccess="always" type="application/x-shockwave-flash"></embed> 
  14. </object>', $width, $height, $url, $width, $height, $url ) );