Make WordPress Core


Ignore:
Timestamp:
11/02/2009 02:41:35 PM (16 years ago)
Author:
ryan
Message:

Switch oEmbed option to control discovery. Tweak whitelist and settings page. Props Viper007Bond. see #10337

File:
1 edited

Legend:

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

    r12096 r12136  
    929929
    930930        // After a post is saved, cache oEmbed items via AJAX
    931         if ( get_option('embed_useoembed') )
    932             add_action( 'edit_form_advanced', array(&$this, 'maybe_run_ajax_cache') );
     931        add_action( 'edit_form_advanced', array(&$this, 'maybe_run_ajax_cache') );
    933932    }
    934933
     
    10601059
    10611060        // Unknown URL format. Let oEmbed have a go.
    1062         if ( $post_ID && get_option('embed_useoembed') ) {
     1061        if ( $post_ID ) {
    10631062
    10641063            // Check for a cached result (stored in the post meta)
     
    10761075
    10771076            // Use oEmbed to get the HTML
    1078             $attr['discover'] = author_can( $post_ID, 'unfiltered_html' );
     1077            $attr['discover'] = ( get_option( 'embed_oembed_discover' ) && author_can( $post_ID, 'unfiltered_html' ) ) ? true : false;
    10791078            $html = wp_oembed_get( $url, $attr );
    10801079
Note: See TracChangeset for help on using the changeset viewer.