Function: wp_oembed_ensure_format

wp_oembed_ensure_format( string $format )

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

Parameters

Name Type(s) Default Value Description
$format string

The oEmbed response format. Accepts 'json' or 'xml'.

Returns

string

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

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.