wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_oembed_ensure_format › WordPress Function

Da4.4.0
Deprecaton/a
wp_oembed_ensure_format ( $format )
Parametri:
  • (string) $format The oEmbed response format. Accepts 'json' or 'xml'.
    Richiesto:
Ritorna:
  • (string) The format, either 'xml' or 'json'. Default 'json'.
Definito a:
Codex:

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



Sorgenti

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

	return $format;
}