wp_oembed_ensure_format( string $format )
Ensures that the specified format is either ‘json’ or ‘xml’.
Description Description
Parameters Parameters
- $format
-
(string) (Required) The oEmbed response format. Accepts 'json' or 'xml'.
Return Return
(string) The format, either 'xml' or 'json'. Default 'json'.
Source Source
File: wp-includes/embed.php
function wp_oembed_ensure_format( $format ) { if ( ! in_array( $format, array( 'json', 'xml' ), true ) ) { return 'json'; } return $format; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
4.4.0 | Introduced. |