WordPress at a glance
function is not described

wp_oembed_ensure_format() WP 4.4.0

Ensures that the specified format is either 'json' or 'xml'.

No Hooks.


String. The format, either 'xml' or 'json'.


wp_oembed_ensure_format( $format );
$format(string) (required)
The oEmbed response format. Accepts 'json' or 'xml'.

Code of wp oembed ensure format: wp-includes/embed.php WP 5.2.2

function wp_oembed_ensure_format( $format ) {
	if ( ! in_array( $format, array( 'json', 'xml' ), true ) ) {
		return 'json';

	return $format;