rest_parse_embed_param( string|array $embed )

Parses the “_embed” parameter into the list of resources to embed.


Parameters Parameters

$embed

(string|array) (Required) Raw "_embed" parameter value.


Top ↑

Return Return

(true|string[]) Either true to embed all embeds, or a list of relations to embed.


Top ↑

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


Top ↑

Changelog Changelog

Changelog
Version Description
5.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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