wpseek.com
WordPress开发者和主题制作者的搜索引擎



rest_parse_embed_param › WordPress Function

Since5.4.0
已弃用n/a
rest_parse_embed_param ( $embed )
参数:
  • (string|array) $embed Raw "_embed" parameter value.
    Required: Yes
返回:
  • (true|string[]) Either true to embed all embeds, or a list of relations to embed.
定义在:
文档:

Parses the "_embed" parameter into the list of resources to embed.



源码

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