rest_parse_embed_param( string|array   $embed ): true|string[]

Parses the “_embed” parameter into the list of ressources 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

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

Changuelog

Versionen Description
5.4.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.