WordPress.org

Make WordPress Core

Ticket #23419: 23419.diff

File 23419.diff, 2.1 KB (added by kovshenin, 5 years ago)
  • wp-includes/class-oembed.php

     
    4747                        'http://wordpress.tv/*'                              => array( 'http://wordpress.tv/oembed/',                       false ),
    4848                        '#https?://(.+\.)?polldaddy\.com/.*#i'               => array( 'http://polldaddy.com/oembed/',                      true  ),
    4949                        '#https?://(www\.)?funnyordie\.com/videos/.*#i'      => array( 'http://www.funnyordie.com/oembed',                  true  ),
    50                         '#https?://(www\.)?twitter.com/.+?/status(es)?/.*#i' => array( 'http://api.twitter.com/1/statuses/oembed.{format}', true  ),
    5150                        '#https?://(www\.)?soundcloud\.com/.*#i'             => array( 'http://soundcloud.com/oembed',                      true  ),
    5251                        '#https?://(www\.)?slideshare.net/*#'                => array( 'http://www.slideshare.net/api/oembed/2',            true  ),
    5352                        '#http://instagr(\.am|am\.com)/p/.*#i'               => array( 'http://api.instagram.com/oembed',                   true  ),
  • wp-includes/media.php

     
    10831083        if ( ! apply_filters( 'load_default_embeds', true ) )
    10841084                return;
    10851085        wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
     1086        wp_embed_register_handler( 'twitter', '#https?://(www\.)?twitter.com/.+?/status(es)?/.*#i', 'wp_embed_handler_twitter' );
    10861087}
    10871088
    10881089/**
     
    11101111}
    11111112
    11121113/**
     1114 * Twitter embed handler callback
     1115 */
     1116function wp_embed_handler_twitter( $matches, $attr, $url, $rawattr ) {
     1117        wp_enqueue_script( 'twitter-widgets', '//platform.twitter.com/widgets.js', array(), false, true );
     1118        return sprintf( '<blockquote class="twitter-tweet"><a href="%s">%s</a></blockquote>', esc_url( $url ), esc_html__( 'View embedded content' ) );
     1119}
     1120
     1121/**
    11131122 * {@internal Missing Short Description}}
    11141123 *
    11151124 * @since 2.3.0