Make WordPress Core

Changeset 17751


Ignore:
Timestamp:
04/28/2011 05:03:23 PM (14 years ago)
Author:
nacin
Message:

Remove default-embeds.php. fixes #17112.

Location:
trunk/wp-includes
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r17748 r17751  
    31983198
    31993199/**
    3200  * Determines if default embed handlers should be loaded.
    3201  *
    3202  * Checks to make sure that the embeds library hasn't already been loaded. If
    3203  * it hasn't, then it will load the embeds library.
    3204  *
    3205  * @since 2.9.0
    3206  */
    3207 function wp_maybe_load_embeds() {
    3208     if ( ! apply_filters('load_default_embeds', true) )
    3209         return;
    3210     require_once( ABSPATH . WPINC . '/default-embeds.php' );
    3211 }
    3212 
    3213 /**
    32143200 * Determines if Widgets library should be loaded.
    32153201 *
  • trunk/wp-includes/media.php

    r17749 r17751  
    14001400    $oembed->providers[$format] = array( $provider, $regex );
    14011401}
     1402
     1403/**
     1404 * Determines if default embed handlers should be loaded.
     1405 *
     1406 * Checks to make sure that the embeds library hasn't already been loaded. If
     1407 * it hasn't, then it will load the embeds library.
     1408 *
     1409 * @since 2.9.0
     1410 */
     1411function wp_maybe_load_embeds() {
     1412    if ( ! apply_filters( 'load_default_embeds', true ) )
     1413        return;
     1414    wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
     1415}
     1416
     1417/**
     1418 * The Google Video embed handler callback. Google Video does not support oEmbed.
     1419 *
     1420 * @see WP_Embed::register_handler()
     1421 * @see WP_Embed::shortcode()
     1422 *
     1423 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
     1424 * @param array $attr Embed attributes.
     1425 * @param string $url The original URL that was matched by the regex.
     1426 * @param array $rawattr The original unmodified attributes.
     1427 * @return string The embed HTML.
     1428 */
     1429function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
     1430    // If the user supplied a fixed width AND height, use it
     1431    if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {
     1432        $width  = (int) $rawattr['width'];
     1433        $height = (int) $rawattr['height'];
     1434    } else {
     1435        list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );
     1436    }
     1437
     1438    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" />', $matches, $attr, $url, $rawattr );
     1439}
     1440
     1441?>
Note: See TracChangeset for help on using the changeset viewer.