Changeset 12027
- Timestamp:
- 10/13/2009 10:36:24 PM (15 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r12023 r12027 963 963 * Whether author of supplied post has capability or role. 964 964 * 965 * @since 2.9 965 * @since 2.9.0 966 966 * 967 967 * @param int|object $post Post ID or post object. -
trunk/wp-includes/class-oembed.php
r12023 r12027 38 38 // so only providers in this array will be used for them. 39 39 $this->providers = apply_filters( 'oembed_providers', array( 40 'http://*.youtube.com/watch*' => 'http://www.youtube.com/oembed', 41 'http://youtube.com/watch*' => 'http://www.youtube.com/oembed', 40 42 'http://blip.tv/file/*' => 'http://blip.tv/oembed/', 41 43 'http://*.flickr.com/*' => 'http://www.flickr.com/services/oembed/', 44 'http://www.hulu.com/watch/*' => 'http://www.hulu.com/api/oembed.{format}', 42 45 'http://*.viddler.com/*' => 'http://lab.viddler.com/services/oembed/', 43 46 'http://qik.com/*' => 'http://qik.com/api/oembed.{format}', 44 47 'http://*.revision3.com/*' => 'http://revision3.com/api/oembed/', 45 'http://www.hulu.com/watch/*' => 'http://www.hulu.com/api/oembed.{format}',46 48 47 49 // Vimeo uses the discovery <link>, so leave this commented to use it as a discovery test -
trunk/wp-includes/default-embeds.php
r12023 r12027 7 7 * @subpackage Embeds 8 8 */ 9 10 /**11 * The YouTube.com embed handler callback. YouTube does not support oEmbed and we want to provide extra customization.12 *13 * @see WP_Embed::register_handler()14 * @see WP_Embed::shortcode()15 *16 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.17 * @param array $attr Embed attributes.18 * @param string $url The original URL that was matched by the regex.19 * @param array $rawattr The original unmodified attributes.20 * @return string The embed HTML.21 */22 function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {23 // If the user supplied a fixed width AND height, use it24 if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {25 $width = (int) $rawattr['width'];26 $height = (int) $rawattr['height'];27 } else {28 list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );29 }30 31 return apply_filters( 'embed_youtube', '<object width="' . esc_attr($width) . '" height="' . esc_attr($height) . '"><param name="movie" value="http://www.youtube.com/v/' . esc_attr($matches[3]) . '&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' . esc_attr($matches[3]) . '&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '"></embed></object>', $matches, $attr, $url, $rawattr );32 }33 wp_embed_register_handler( 'youtube', '#http://(www.youtube|youtube|[A-Za-z]{2}.youtube)\.com/(watch\?v=|w/\?v=|\?v=)([\w-]+)(.*?)#i', 'wp_embed_handler_youtube' );34 35 9 36 10 /** -
trunk/wp-includes/formatting.php
r12023 r12027 2359 2359 case 'large_size_w': 2360 2360 case 'large_size_h': 2361 //case 'embed_size_w':2362 2361 case 'embed_size_h': 2363 2362 case 'default_post_edit_rows': … … 2376 2375 break; 2377 2376 2377 case 'embed_size_w': 2378 if ( '' !== $value ) 2379 $value = absint( $value ); 2380 break; 2381 2378 2382 case 'posts_per_page': 2379 2383 case 'posts_per_rss': -
trunk/wp-includes/media.php
r12023 r12027 1135 1135 * Register an embed handler. This function should probably only be used for sites that do not support oEmbed. 1136 1136 * 1137 * @since 2.9.0 1137 1138 * @see WP_Embed::register_handler() 1138 1139 */ … … 1145 1146 * Unregister a previously registered embed handler. 1146 1147 * 1148 * @since 2.9.0 1147 1149 * @see WP_Embed::unregister_handler() 1148 1150 */ … … 1154 1156 /** 1155 1157 * Create default array of embed parameters. 1158 * 1159 * @since 2.9.0 1156 1160 * 1157 1161 * @return array Default embed parameters. … … 1178 1182 * Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height. 1179 1183 * 1184 * @since 2.9.0 1180 1185 * @uses wp_constrain_dimensions() This function passes the widths and the heights. 1181 1186 * … … 1198 1203 * Attempts to fetch the embed HTML for a provided URL using oEmbed. 1199 1204 * 1205 * @since 2.9.0 1200 1206 * @see WP_oEmbed 1201 1207 * … … 1212 1218 return $oembed->get_html( $url, $args ); 1213 1219 } 1220 1221 /** 1222 * Adds a URL format and oEmbed provider URL pair. 1223 * 1224 * @since 2.9.0 1225 * @see WP_oEmbed 1226 * 1227 * @uses _wp_oembed_get_object() 1228 * 1229 * @param string $format The format of URL that this provider can handle. Use asterisks as wildcards. 1230 * @param string $provider The URL to the oEmbed provider. 1231 */ 1232 function wp_oembed_add_provider( $format, $provider ) { 1233 require_once( 'class-oembed.php' ); 1234 $oembed = _wp_oembed_get_object(); 1235 $oembed->providers[$format] = $provider; 1236 }
Note: See TracChangeset
for help on using the changeset viewer.