On this page
rest_parse_embed_param( string|array $embed ): true|string[]
Parses the “_embed” parameter into the list of resources to embed.
Parameters
$embedstring|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. View all references
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;
}
Related
Uses
| Uses | Description |
|---|---|
| wp_parse_list() wp-includes/functions.php | Converts a comma- or space-separated list of scalar values to an array. |
Used By
| Used By | Description |
|---|---|
| rest_preload_api_request() wp-includes/rest-api.php | Append result of internal request to REST API for purpose of preloading data to be attached to a page. |
| WP_REST_Server::serve_request() wp-includes/rest-api/class-wp-rest-server.php | Handles serving a REST API request. |
Changelog
| Version | Description |
|---|---|
| 5.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_parse_embed_param