rest_parse_embed_param() WordPress Function
The rest_parse_embed_param() function is used to parse the value of the oembed parameter in a WordPress request. The function is used to determine the URL of the oembed resource, and the format of the response.
rest_parse_embed_param( string|array $embed ) #
Parses the “_embed” parameter into the list of resources to embed.
Parameters
- $embed
(string|array)(Required)Raw "_embed" parameter value.
Return
(true|string[]) Either true to embed all embeds, or a list of relations to embed.
Source
File: wp-includes/rest-api.php
function rest_parse_embed_param( $embed ) { if ( ! $embed || 'true' === $embed || '1' === $embed ) { return true; } $rels = wp_parse_list( $embed ); if ( ! $rels ) { return true; } return $rels; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.4.0 | Introduced. |