Make WordPress Core

Ticket #36304: 36304.2.patch

File 36304.2.patch, 2.6 KB (added by Viper007Bond, 9 years ago)

Deprecate the function instead of removing it

  • src/wp-includes/embed.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    175175
    176176        wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/(?:v|embed)/([^/]+)#i', 'wp_embed_handler_youtube' );
    177177
    178         wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
    179 
    180178        /**
    181179         * Filter the audio embed handler callback.
    182180         *
     
    197195}
    198196
    199197/**
    200  * The Google Video embed handler callback.
     198 * Deprecated function that previously assisted in turning Google Video URLs
     199 * into embeds but that service has since been shut down.
    201200 *
    202  * Google Video does not support oEmbed.
     201 * @deprecated 4.6.0
    203202 *
    204  * @see WP_Embed::register_handler()
    205  * @see WP_Embed::shortcode()
    206  *
    207  * @param array  $matches The RegEx matches from the provided regex when calling wp_embed_register_handler().
    208  * @param array  $attr    Embed attributes.
    209  * @param string $url     The original URL that was matched by the regex.
    210  * @param array  $rawattr The original unmodified attributes.
    211  * @return string The embed HTML.
     203 * @return string An empty string.
    212204 */
    213205function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
    214         // If the user supplied a fixed width AND height, use it
    215         if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {
    216                 $width  = (int) $rawattr['width'];
    217                 $height = (int) $rawattr['height'];
    218         } else {
    219                 list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );
    220         }
     206        _deprecated_function( __FUNCTION__, '4.6.0' );
    221207
    222         /**
    223          * Filter the Google Video embed output.
    224          *
    225          * @since 2.9.0
    226          *
    227          * @param string $html    Google Video HTML embed markup.
    228          * @param array  $matches The RegEx matches from the provided regex.
    229          * @param array  $attr    An array of embed attributes.
    230          * @param string $url     The original URL that was matched by the regex.
    231          * @param array  $rawattr The original unmodified attributes.
    232          */
    233         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 );
     208        return '';
    234209}
    235210
    236211/**