wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_oembed_ensure_format › WordPress Function

Depuis4.4.0
Dépréciéen/a
wp_oembed_ensure_format ( $format )
Paramètres:
  • (string) $format The oEmbed response format. Accepts 'json' or 'xml'.
    Requis: Oui
Retourne:
  • (string) The format, either 'xml' or 'json'. Default 'json'.
Défini(e) dans:
Codex:

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



Source

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

	return $format;
}