title: Filtering WordPress oEmbed provider list
body: <p>How would I filter the WordPress oEmbed provider list? My aim is to allow just Twitter and Youtube.</p>
  
  <p><strong>EDIT:</strong> Could I do something like this?</p>
  
  <pre><code>function filter_oembed_provider_list( $array ) {
      $array = array( 'http://youtu.be/*' =&gt; array( 'http://www.youtube.com/oembed',                     false ) );
      return $array;
  }
  add_filter( 'oembed_providers', 'filter_oembed_provider_list' );
  </code></pre>
  
  <p>But this doesn't seem to work.</p>
  
  <p>Please see the relevant code in class-oembed.php:</p>
  
  <pre><code>apply_filters( 'oembed_providers', array(
          '#https?://(www\.)?youtube\.com/watch.*#i'           =&gt; array( 'http://www.youtube.com/oembed',                     true  ),
          'http://youtu.be/*'                                  =&gt; array( 'http://www.youtube.com/oembed',                     false ),
          'http://blip.tv/*'                                   =&gt; array( 'http://blip.tv/oembed/',                            false ),
          '#https?://(www\.)?vimeo\.com/.*#i'                  =&gt; array( 'http://vimeo.com/api/oembed.{format}',              true  ),
          '#https?://(www\.)?dailymotion\.com/.*#i'            =&gt; array( 'http://www.dailymotion.com/services/oembed',        true  ),
          'http://dai.ly/*'                                    =&gt; array( 'http://www.dailymotion.com/services/oembed',        false ),
          '#https?://(www\.)?flickr\.com/.*#i'                 =&gt; array( 'http://www.flickr.com/services/oembed/',            true  ),
          'http://flic.kr/*'                                   =&gt; array( 'http://www.flickr.com/services/oembed/',            false ),
          '#https?://(.+\.)?smugmug\.com/.*#i'                 =&gt; array( 'http://api.smugmug.com/services/oembed/',           true  ),
          '#https?://(www\.)?hulu\.com/watch/.*#i'             =&gt; array( 'http://www.hulu.com/api/oembed.{format}',           true  ),
          '#https?://(www\.)?viddler\.com/.*#i'                =&gt; array( 'http://lab.viddler.com/services/oembed/',           true  ),
          'http://qik.com/*'                                   =&gt; array( 'http://qik.com/api/oembed.{format}',                false ),
          'http://revision3.com/*'                             =&gt; array( 'http://revision3.com/api/oembed/',                  false ),
          'http://i*.photobucket.com/albums/*'                 =&gt; array( 'http://photobucket.com/oembed',                     false ),
          'http://gi*.photobucket.com/groups/*'                =&gt; array( 'http://photobucket.com/oembed',                     false ),
          '#https?://(www\.)?scribd\.com/.*#i'                 =&gt; array( 'http://www.scribd.com/services/oembed',             true  ),
          'http://wordpress.tv/*'                              =&gt; array( 'http://wordpress.tv/oembed/',                       false ),
          '#https?://(.+\.)?polldaddy\.com/.*#i'               =&gt; array( 'http://polldaddy.com/oembed/',                      true  ),
          '#https?://(www\.)?funnyordie\.com/videos/.*#i'      =&gt; array( 'http://www.funnyordie.com/oembed',                  true  ),
          '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i'=&gt; array( 'http://api.twitter.com/1/statuses/oembed.{format}', true  ),
          '#https?://(www\.)?soundcloud\.com/.*#i'             =&gt; array( 'http://soundcloud.com/oembed',                      true  ),
          '#https?://(www\.)?slideshare\.net/*#'               =&gt; array( 'http://www.slideshare.net/api/oembed/2',            true  ),
          '#http://instagr(\.am|am\.com)/p/.*#i'               =&gt; array( 'http://api.instagram.com/oembed',                   true  ),
          '#https?://(www\.)?rdio\.com/.*#i'                   =&gt; array( 'http://www.rdio.com/api/oembed/',                   true  ),
          '#https?://rd\.io/x/.*#i'                            =&gt; array( 'http://www.rdio.com/api/oembed/',                   true  ),
          '#https?://(open|play)\.spotify\.com/.*#i'           =&gt; array( 'https://embed.spotify.com/oembed/',                 true  ),
      ) );
  </code></pre>