Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: oembed_providers

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
30      /**
31       * PHP5 constructor
32       *
33       * @uses apply_filters() Filters a list of pre-defined oEmbed providers.
34       */
35      function __construct() {
36           // List out some popular sites that support oEmbed.
37           // The WP_Embed class disables discovery for non-unfiltered_html users, so only providers in this array will be used for them.
38           // Add to this list using the wp_oembed_add_provider() function (see it's PHPDoc for details).
39           $this->providers = apply_filters( 'oembed_providers', array(
40                '#http://(www\.)?youtube.com/watch.*#i'         => array( 'http://www.youtube.com/oembed',            true  ),
41                'http://youtu.be/*'                             => array( 'http://www.youtube.com/oembed',            false ),
42                'http://blip.tv/file/*'                         => array( 'http://blip.tv/oembed/',                   false ),
43                '#http://(www\.)?vimeo\.com/.*#i'               => array( 'http://www.vimeo.com/api/oembed.{format}', true  ),
44                '#http://(www\.)?dailymotion\.com/.*#i'         => array( 'http://www.dailymotion.com/api/oembed',    true  ),
45                '#http://(www\.)?flickr\.com/.*#i'              => array( 'http://www.flickr.com/services/oembed/',   true  ),
46                '#http://(.+)?smugmug\.com/.*#i'                => array( 'http://api.smugmug.com/services/oembed/',  true  ),
47                '#http://(www\.)?hulu\.com/watch/.*#i'          => array( 'http://www.hulu.com/api/oembed.{format}',  true  ),
48                '#http://(www\.)?viddler\.com/.*#i'             => array( 'http://lab.viddler.com/services/oembed/',  true  ),