[ Index ]

PHP Cross Reference of Wordpress 2.9.1

title

Body

[close]

/wp-includes/ -> default-embeds.php (source)

   1  <?php
   2  
   3  /**
   4   * Default Embed Handlers
   5   *
   6   * @package WordPress
   7   * @subpackage Embeds
   8   */
   9  
  10  /**
  11   * The Google Video embed handler callback. Google Video does not support oEmbed.
  12   *
  13   * @see WP_Embed::register_handler()
  14   * @see WP_Embed::shortcode()
  15   *
  16   * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
  17   * @param array $attr Embed attributes.
  18   * @param string $url The original URL that was matched by the regex.
  19   * @param array $rawattr The original unmodified attributes.
  20   * @return string The embed HTML.
  21   */
  22  function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
  23      // If the user supplied a fixed width AND height, use it
  24      if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {
  25          $width  = (int) $rawattr['width'];
  26          $height = (int) $rawattr['height'];
  27      } else {
  28          list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );
  29      }
  30  
  31      return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&amp;hl=en&amp;fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always"></embed>', $matches, $attr, $url, $rawattr );
  32  }
  33  wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
  34  
  35  /**
  36   * The PollDaddy.com embed handler callback. PollDaddy does not support oEmbed, at least not yet.
  37   *
  38   * @see WP_Embed::register_handler()
  39   * @see WP_Embed::shortcode()
  40   *
  41   * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
  42   * @param array $attr Embed attributes.
  43   * @param string $url The original URL that was matched by the regex.
  44   * @param array $rawattr The original unmodified attributes.
  45   * @return string The embed HTML.
  46   */
  47  function wp_embed_handler_polldaddy( $matches, $attr, $url, $rawattr ) {
  48      return apply_filters( 'embed_polldaddy', '<script type="text/javascript" charset="utf8" src="http://s3.polldaddy.com/p/' . esc_attr($matches[1]) . '"></script>', $matches, $attr, $url, $rawattr );
  49  }
  50  wp_embed_register_handler( 'polldaddy', '#http://answers.polldaddy.com/poll/(\d+)(.*?)#i', 'wp_embed_handler_polldaddy' );
  51  
  52  ?>


Generated: Fri Jan 8 00:19:48 2010 Cross-referenced by PHPXref 0.7