WordPress Version: 4.4
/**
* Ensures that the specified format is either 'json' or 'xml'.
*
* @since 4.4.0
*
* @param string $format The oEmbed response format. Accepts 'json' or 'xml'.
* @return string The format, either 'xml' or 'json'. Default 'json'.
*/
function wp_oembed_ensure_format($format)
{
if (!in_array($format, array('json', 'xml'), true)) {
return 'json';
}
return $format;
}