Make WordPress Core


Ignore:
Timestamp:
10/13/2009 10:36:24 PM (14 years ago)
Author:
ryan
Message:

Use oEmbed for youtube. Props Viper007Bond. see #10337

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r12023 r12027  
    11351135 * Register an embed handler. This function should probably only be used for sites that do not support oEmbed.
    11361136 *
     1137 * @since 2.9.0
    11371138 * @see WP_Embed::register_handler()
    11381139 */
     
    11451146 * Unregister a previously registered embed handler.
    11461147 *
     1148 * @since 2.9.0
    11471149 * @see WP_Embed::unregister_handler()
    11481150 */
     
    11541156/**
    11551157 * Create default array of embed parameters.
     1158 *
     1159 * @since 2.9.0
    11561160 *
    11571161 * @return array Default embed parameters.
     
    11781182 * Based on a supplied width/height example, return the biggest possible dimensions based on the max width/height.
    11791183 *
     1184 * @since 2.9.0
    11801185 * @uses wp_constrain_dimensions() This function passes the widths and the heights.
    11811186 *
     
    11981203 * Attempts to fetch the embed HTML for a provided URL using oEmbed.
    11991204 *
     1205 * @since 2.9.0
    12001206 * @see WP_oEmbed
    12011207 *
     
    12121218    return $oembed->get_html( $url, $args );
    12131219}
     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 */
     1232function 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.