wp_oembed_ensure_format( string $format ): string

Ensures that the specified format is either ‘json’ or ‘xml’.


Parameters

$format string Required
The oEmbed response format. Accepts 'json' or 'xml'.

Top ↑

Return

string The format, either 'xml' or 'json'. Default 'json'.


Top ↑

Source

File: wp-includes/embed.php. View all references

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

	return $format;
}

Top ↑

Changelog

Changelog
Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.