wpseek.com
A WordPress-centric search engine for devs and theme authors



rest_parse_embed_param › WordPress Function

Since5.4.0
Deprecatedn/a
rest_parse_embed_param ( $embed )
Parameters:
  • (string|array) $embed Raw "_embed" parameter value.
    Required: Yes
Returns:
  • (true|string[]) Either true to embed all embeds, or a list of relations to embed.
Defined at:
Codex:

Parses the "_embed" parameter into the list of resources 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;
}