classes/fields/oembed.php
public function get_providers() {

		// Return class property if already set
		if ( ! empty( $this->providers ) ) {
			return $this->providers;
		}

		if ( file_exists( ABSPATH . WPINC . '/class-oembed.php' ) ) {
			require_once ABSPATH . WPINC . '/class-oembed.php';
		}

		// Return an empty array if no providers could be found
		$providers = array();

		if ( function_exists( '_wp_oembed_get_object' ) ) {
			$wp_oembed = _wp_oembed_get_object();
			$providers = $wp_oembed->providers;

			foreach ( $providers as $key => $provider ) {
				$url  = wp_parse_url( $provider[0] );
				$host = $url['host'];
				$tmp  = explode( '.', $host );

				if ( count( $tmp ) === 3 ) {
					// Take domain names like .co.uk in consideration
					if ( ! in_array( 'co', $tmp, true ) ) {
						unset( $tmp[0] );
					}
				} elseif ( count( $tmp ) === 4 ) {
					// Take domain names like .co.uk in consideration
					unset( $tmp[0] );
				}

				$host = implode( '.', $tmp );

				$providers[ $key ]['host'] = $host;
			}

			$this->providers = $providers;
		}//end if

		return $providers;

	}
public function get_providers() {

		// Return class property if already set
		if ( ! empty( $this->providers ) ) {
			return $this->providers;
		}

		if ( file_exists( ABSPATH . WPINC . '/class-oembed.php' ) ) {
			require_once ABSPATH . WPINC . '/class-oembed.php';
		}

		// Return an empty array if no providers could be found
		$providers = array();

		if ( function_exists( '_wp_oembed_get_object' ) ) {
			$wp_oembed = _wp_oembed_get_object();
			$providers = $wp_oembed->providers;

			foreach ( $providers as $key => $provider ) {
				$url  = wp_parse_url( $provider[0] );
				$host = $url['host'];
				$tmp  = explode( '.', $host );

				if ( count( $tmp ) === 3 ) {
					// Take domain names like .co.uk in consideration
					if ( ! in_array( 'co', $tmp, true ) ) {
						unset( $tmp[0] );
					}
				} elseif ( count( $tmp ) === 4 ) {
					// Take domain names like .co.uk in consideration
					unset( $tmp[0] );
				}

				$host = implode( '.', $tmp );

				$providers[ $key ]['host'] = $host;
			}

			$this->providers = $providers;
		}//end if

		return $providers;

	}
public function get_providers ( ) { // Return class property if already set if ( ! empty ( $ this -> providers ) ) { return $ this -> providers ; } if ( file_exists ( ABSPATH . WPINC . '/class-oembed.php' ) ) { require_once ABSPATH . WPINC . '/class-oembed.php' ; } // Return an empty array if no providers could be found $ providers = array ( ) ; if ( function_exists ( '_wp_oembed_get_object' ) ) { $ wp_oembed = _wp_oembed_get_object ( ) ; $ providers = $ wp_oembed -> providers ; foreach ( $ providers as $ key => $ provider ) { $ url = wp_parse_url ( $ provider [ 0 ] ) ; $ host = $ url [ 'host' ] ; $ tmp = explode ( '.' , $ host ) ; if ( count ( $ tmp ) === 3 ) { // Take domain names like .co.uk in consideration if ( ! in_array ( 'co' , $ tmp , true ) ) { unset ( $ tmp [ 0 ] ) ; } } elseif ( count ( $ tmp ) === 4 ) { // Take domain names like .co.uk in consideration unset ( $ tmp [ 0 ] ) ; } $ host = implode ( '.' , $ tmp ) ; $ providers [ $ key ] [ 'host' ] = $ host ; } $ this -> providers = $ providers ; } //end if return $ providers ; }
Get a list of available providers from the WP_oEmbed class

@see   wp-includes/class-oembed.php
@return array $providers {
Array of provider data with regex as key

@type string URL for this provider
@type int
@type string Hostname for this provider
}

@since 2.7.0
Get a list of available providers from the WP_oEmbed class