[wp-trac] [WordPress Trac] #16327: oEmbed - Add a function to remove an oEmbed provider

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 21 00:48:23 UTC 2011


#16327: oEmbed - Add a function to remove an oEmbed provider
--------------------------+-----------------------------
 Reporter:  r-a-y         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  3.1
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 In /wp-includes/media.php, there's the ability to add an oEmbed provider
 with '''wp_oembed_add_provider()''', but no way to remove one.

 The attached patch is an attempt to allow you to remove an oEmbed
 provider.

 For the $match parameter, I've opted to allow you to match any portion of
 the $format key.

 For example, to remove the YouTube oEmbed provider, you can use:

 {{{
 wp_oembed_remove_provider( '#http://(www\.)?youtube.com/watch.*#i',
 'http://www.youtube.com/oembed' );

 }}}

 or:

 {{{
 wp_oembed_remove_provider( 'youtube.com', 'http://www.youtube.com/oembed'
 );
 }}}

 ---

 If partial matching for the $format key is undesired, let me know and I'll
 repatch for an exact match only.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16327>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list