public function list_providers( $args, $assoc_args ) {

		$oembed = new oEmbed();

		$force_regex = Utils\get_flag_value( $assoc_args, 'force-regex' );

		$providers = array();

		foreach ( (array) $oembed->providers as $matchmask => $data ) {
			list( $providerurl, $regex ) = $data;

			// Turn the asterisk-type provider URLs into regex
			if ( $force_regex && ! $regex ) {
				$matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
				$matchmask = preg_replace( '|^#http\\\://|', '#https?\://', $matchmask );
			}

			$providers[] = array(
				'format'   => $matchmask,
				'endpoint' => $providerurl,
				'regex'    => $regex ? '1' : '0',
			);
		}

		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_items( $providers );
	}
public function list_providers( $args, $assoc_args ) {

		$oembed = new oEmbed();

		$force_regex = Utils\get_flag_value( $assoc_args, 'force-regex' );

		$providers = array();

		foreach ( (array) $oembed->providers as $matchmask => $data ) {
			list( $providerurl, $regex ) = $data;

			// Turn the asterisk-type provider URLs into regex
			if ( $force_regex && ! $regex ) {
				$matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
				$matchmask = preg_replace( '|^#http\\\://|', '#https?\://', $matchmask );
			}

			$providers[] = array(
				'format'   => $matchmask,
				'endpoint' => $providerurl,
				'regex'    => $regex ? '1' : '0',
			);
		}

		$formatter = $this->get_formatter( $assoc_args );
		$formatter->display_items( $providers );
	}
public function list_providers ( $ args , $ assoc_args ) { $ oembed = new oEmbed ( ) ; $ force_regex = Utils \ get_flag_value ( $ assoc_args , 'force-regex' ) ; $ providers = array ( ) ; foreach ( ( array ) $ oembed -> providers as $ matchmask => $ data ) { list ( $ providerurl , $ regex ) = $ data ; // Turn the asterisk-type provider URLs into regex if ( $ force_regex && ! $ regex ) { $ matchmask = '#' . str_replace ( '___wildcard___' , '(.+)' , preg_quote ( str_replace ( '*' , '___wildcard___' , $ matchmask ) , '#' ) ) . '#i' ; $ matchmask = preg_replace ( '|^#http\\\://|' , '#https?\://' , $ matchmask ) ; } $ providers [ ] = array ( 'format' => $ matchmask , 'endpoint' => $ providerurl , 'regex' => $ regex ? '1' : '0' , ) ; } $ formatter = $ this -> get_formatter ( $ assoc_args ) ; $ formatter -> display_items ( $ providers ) ; }
Lists all available oEmbed providers.

## OPTIONS

[--field=<field>]
: Display the value of a single field

[--fields=<fields>]
: Limit the output to specific fields.

[--format=<format>]
: Render output in a particular format.
---
default: table
options:
- table
- csv
- json
---

[--force-regex]
: Turn the asterisk-type provider URLs into regexes.

## AVAILABLE FIELDS

These fields will be displayed by default for each provider:

* format
* endpoint

This field is optionally available:

* regex

## EXAMPLES

# List format,endpoint fields of available providers.
$ wp embed provider list --fields=format,endpoint
+------------------------------+-----------------------------------------+
| format                       | endpoint                                |
+------------------------------+-----------------------------------------+
| #https?://youtu\.be/.*#i     | https://www.youtube.com/oembed          |
| #https?://flic\.kr/.*#i      | https://www.flickr.com/services/oembed/ |
| #https?://wordpress\.tv/.*#i | https://wordpress.tv/oembed/            |

@subcommand list
Lists all available oEmbed providers .