wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_oembed_ensure_format › WordPress Function

Desde4.4.0
Obsoleton/a
wp_oembed_ensure_format ( $format )
Parâmetros:
  • (string) $format The oEmbed response format. Accepts 'json' or 'xml'.
    Required: Yes
Retorna:
  • (string) The format, either 'xml' or 'json'. Default 'json'.
Definido em:
Codex:

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



Fonte

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

	return $format;
}