rest_parse_embed_param() WordPress Function

The rest_parse_embed_param() function is used to parse the value of the oembed parameter in a WordPress request. The function is used to determine the URL of the oembed resource, and the format of the response.

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.


Top ↑

Return

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


Top ↑

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
VersionDescription
5.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More