W3cubDocs

/WordPress

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;
}

Changelog

Version Description
5.4.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_parse_embed_param