Ticket #28372: 28372.diff
File 28372.diff, 5.4 KB (added by , 10 years ago) |
---|
-
src/wp-includes/class-oembed.php
21 21 public $providers = array(); 22 22 23 23 /** 24 * Constructor 25 * 26 * @uses apply_filters() Filters a list of pre-defined oEmbed providers. 24 * Constructor. 27 25 */ 28 26 public function __construct() { 29 $providers = array( 27 /** 28 * Filter the list of oEmbed providers. 29 * 30 * Discovery is disabled for users lacking the unfiltered_html capability. 31 * Only providers in this array will be used for those users. 32 * 33 * Supported providers: 34 * 35 * | Provider | Flavor | Since | 36 * | ------------ | ---------------- | ------------------ | 37 * | Blip | blip.tv | 2.9.0 | 38 * | CollegeHumor | collegehumor.com | 4.0.0 | 39 * | Dailymotion | dailymotion.com | 2.9.0 | 40 * | Dailymotion | dai.ly | 3.6.0 | 41 * | Flickr | flickr.com | 2.9.0 | 42 * | Flickr | flic.kr | 3.6.0 | 43 * | Funny or Die | funnyordie.com | 3.0.0 | 44 * | Hulu | hulu.com | 2.9.0 | 45 * | Imgur | imgur.com | 3.9.0 | 46 * | Issuu | issuu.com | 4.0.0 | 47 * | Instagram | instagram.com | 3.5.0 | 48 * | Instagram | instagr.am | 3.5.0 | 49 * | Meetup.com | meetup.com | 3.9.0 | 50 * | Meetup.com | meetu.ps | 3.9.0 | 51 * | Mixcloud | mixcloud.com | 4.0.0 | 52 * | Photobucket | photobucket.com | 2.9.0 | 53 * | Polldaddy | polldaddy.com | 3.0.0 | 54 * | Polldaddy | poll.fm | 4.0.0 | 55 * | Qik | qik.com | 2.9.0 (deprecated) | 56 * | Rdio | rdio.com | 3.6.0 | 57 * | Rdio | rd.io | 3.6.0 | 58 * | Revision3 | revision3.com | 2.9.0 | 59 * | Scribd | scribd.com | 2.9.0 | 60 * | Slideshare | slideshare.net | 3.5.0 | 61 * | SoundCloud | soundcloud.com | 3.5.0 | 62 * | Spotify | spotify.com | 3.6.0 | 63 * | Twitter | twitter.com | 3.4.0 | 64 * | Viddler | viddler.com | 2.9.0 | 65 * | Vimeo | vimeo.com | 2.9.0 | 66 * | WordPress.tv | wordpress.tv | 2.9.0 | 67 * | YouTube | youtube.com | 2.9.0 | 68 * | YouTube | youtu.be | 3.0.0 | 69 * 70 * @see wp_oembed_add_provider() 71 * 72 * @since 2.9.0 73 * 74 * @param array $providers An array of popular oEmbed providers. 75 */ 76 $this->providers = apply_filters( 'oembed_providers', array( 30 77 '#http://(www\.)?youtube\.com/(watch|playlist).*#i' => array( 'http://www.youtube.com/oembed', true ), 31 78 '#https://(www\.)?youtube\.com/(watch|playlist).*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ), 32 79 '#http://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed', true ), … … 49 96 '#https?://poll\.fm/.*#i' => array( 'http://polldaddy.com/oembed/', true ), 50 97 '#https?://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ), 51 98 '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' => array( 'https://api.twitter.com/1/statuses/oembed.{format}', true ), 52 99 '#https?://(www\.)?soundcloud\.com/.*#i' => array( 'http://soundcloud.com/oembed', true ), 53 100 '#https?://(www\.)?slideshare\.net/*#' => array( 'http://www.slideshare.net/api/oembed/2', true ), 54 101 '#http://instagr(\.am|am\.com)/p/.*#i' => array( 'http://api.instagram.com/oembed', true ), 55 102 '#https?://(www\.)?rdio\.com/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ), … … 60 107 '#https?://(www\.)?issuu\.com/.+/docs/.+#i' => array( 'http://issuu.com/oembed_wp', true ), 61 108 '#https?://(www\.)?collegehumor\.com/video/.*#i' => array( 'http://www.collegehumor.com/oembed.{format}', true ), 62 109 '#https?://(www\.)?mixcloud\.com/.*#i' => array( 'http://www.mixcloud.com/oembed', true ), 63 ) ;110 ) ); 64 111 65 /**66 * Filter the list of oEmbed providers.67 *68 * Discovery is disabled for users lacking the unfiltered_html capability.69 * Only providers in this array will be used for those users.70 *71 * @see wp_oembed_add_provider()72 *73 * @since 2.9.074 *75 * @param array $providers An array of popular oEmbed providers.76 */77 $this->providers = apply_filters( 'oembed_providers', $providers );78 79 112 // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop(). 80 113 add_filter( 'oembed_dataparse', array($this, '_strip_newlines'), 10, 3 ); 81 114 }