Changeset 28652
- Timestamp:
- 06/02/2014 01:21:13 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r28584 r28652 2185 2185 } 2186 2186 2187 wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/embed/([^/]+)#i', 'wp_embed_handler_youtube' ); 2188 2187 2189 wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' ); 2188 2190 … … 2239 2241 */ 2240 2242 return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&hl=en&fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always" />', $matches, $attr, $url, $rawattr ); 2243 } 2244 2245 /** 2246 * The YouTube embed handler callback. Catches URLs that can be parsed but aren't supported by oEmbed. 2247 * 2248 * @since 4.0.0 2249 * 2250 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}. 2251 * @param array $attr Embed attributes. 2252 * @param string $url The original URL that was matched by the regex. 2253 * @param array $rawattr The original unmodified attributes. 2254 * @return string The embed HTML. 2255 */ 2256 function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) { 2257 global $wp_embed; 2258 $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" ); 2259 /** 2260 * Filter the YoutTube embed output. 2261 * 2262 * @since 4.0.0 2263 * 2264 * @param string $embed YouTube embed output. 2265 * @param array $attr An array of embed attributes. 2266 * @param string $url The original URL that was matched by the regex. 2267 * @param array $rawattr The original unmodified attributes. 2268 */ 2269 return apply_filters( 'wp_embed_handler_youtube', $embed, $attr, $url, $rawattr ); 2241 2270 } 2242 2271
Note: See TracChangeset
for help on using the changeset viewer.