wp_embed_handler_googlevideo

The timeline below displays how wordpress function wp_embed_handler_googlevideo has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 4.6

/**
 * The Google Video embed handler callback.
 *
 * Deprecated function that previously assisted in turning Google Video URLs
 * into embeds but that service has since been shut down.
 *
 * @since 2.9.0
 * @deprecated 4.6.0
 *
 * @return string An empty string.
 */
function wp_embed_handler_googlevideo($matches, $attr, $url, $rawattr)
{
    _deprecated_function(__FUNCTION__, '4.6.0');
    return '';
}

WordPress Version: 4.2

/**
 * The Google Video embed handler callback.
 *
 * Google Video does not support oEmbed.
 *
 * @see WP_Embed::register_handler()
 * @see WP_Embed::shortcode()
 *
 * @param array  $matches The RegEx matches from the provided regex when calling wp_embed_register_handler().
 * @param array  $attr    Embed attributes.
 * @param string $url     The original URL that was matched by the regex.
 * @param array  $rawattr The original unmodified attributes.
 * @return string The embed HTML.
 */
function wp_embed_handler_googlevideo($matches, $attr, $url, $rawattr)
{
    // If the user supplied a fixed width AND height, use it
    if (!empty($rawattr['width']) && !empty($rawattr['height'])) {
        $width = (int) $rawattr['width'];
        $height = (int) $rawattr['height'];
    } else {
        list($width, $height) = wp_expand_dimensions(425, 344, $attr['width'], $attr['height']);
    }
    /**
     * Filter the Google Video embed output.
     *
     * @since 2.9.0
     *
     * @param string $html    Google Video HTML embed markup.
     * @param array  $matches The RegEx matches from the provided regex.
     * @param array  $attr    An array of embed attributes.
     * @param string $url     The original URL that was matched by the regex.
     * @param array  $rawattr The original unmodified attributes.
     */
    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);
}

WordPress Version: 3.9

/**
 * The Google Video embed handler callback. Google Video does not support oEmbed.
 *
 * @see WP_Embed::register_handler()
 * @see WP_Embed::shortcode()
 *
 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
 * @param array $attr Embed attributes.
 * @param string $url The original URL that was matched by the regex.
 * @param array $rawattr The original unmodified attributes.
 * @return string The embed HTML.
 */
function wp_embed_handler_googlevideo($matches, $attr, $url, $rawattr)
{
    // If the user supplied a fixed width AND height, use it
    if (!empty($rawattr['width']) && !empty($rawattr['height'])) {
        $width = (int) $rawattr['width'];
        $height = (int) $rawattr['height'];
    } else {
        list($width, $height) = wp_expand_dimensions(425, 344, $attr['width'], $attr['height']);
    }
    /**
     * Filter the Google Video embed output.
     *
     * @since 2.9.0
     *
     * @param string $html    Google Video HTML embed markup.
     * @param array  $matches The regex matches from the provided regex.
     * @param array  $attr    An array of embed attributes.
     * @param string $url     The original URL that was matched by the regex.
     * @param array  $rawattr The original unmodified attributes.
     */
    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);
}

WordPress Version: 3.7

/**
 * The Google Video embed handler callback. Google Video does not support oEmbed.
 *
 * @see WP_Embed::register_handler()
 * @see WP_Embed::shortcode()
 *
 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
 * @param array $attr Embed attributes.
 * @param string $url The original URL that was matched by the regex.
 * @param array $rawattr The original unmodified attributes.
 * @return string The embed HTML.
 */
function wp_embed_handler_googlevideo($matches, $attr, $url, $rawattr)
{
    // If the user supplied a fixed width AND height, use it
    if (!empty($rawattr['width']) && !empty($rawattr['height'])) {
        $width = (int) $rawattr['width'];
        $height = (int) $rawattr['height'];
    } else {
        list($width, $height) = wp_expand_dimensions(425, 344, $attr['width'], $attr['height']);
    }
    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);
}