wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_oembed_ensure_format › WordPress Function

Od4.4.0
Przestarzałyn/a
wp_oembed_ensure_format ( $format )
Parametry:
  • (string) $format The oEmbed response format. Accepts 'json' or 'xml'.
    Wymagane: Tak
Powrót:
  • (string) The format, either 'xml' or 'json'. Default 'json'.
Zdefiniowane na:
Codex:

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



Źródło

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

	return $format;
}