wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



rest_parse_embed_param › WordPress Function

Depuis5.4.0
Dépréciéen/a
rest_parse_embed_param ( $embed )
Paramètres:
  • (string|array) $embed Raw "_embed" parameter value.
    Requis: Oui
Retourne:
  • (true|string[]) Either true to embed all embeds, or a list of relations to embed.
Défini(e) dans:
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;
}