Title: rest_parse_embed_param
Published: April 1, 2020
Last modified: February 24, 2026

---

# rest_parse_embed_param( string|array $embed ): true|string[]

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#wp--skip-link--target)

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#parameters)󠁿

 `$embed`string|arrayrequired

Raw "_embed" parameter value.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#return)󠁿

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

## 󠀁[Source](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/rest-api.php#L3013)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/rest-api.php#L3013-L3025)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_parse_list()](https://developer.wordpress.org/reference/functions/wp_parse_list/)`wp-includes/functions.php` |

Converts a comma- or space-separated list of scalar values to an array.

  |

| Used by | Description | 
| [rest_preload_api_request()](https://developer.wordpress.org/reference/functions/rest_preload_api_request/)`wp-includes/rest-api.php` |

Append result of internal request to REST API for purpose of preloading data to be attached to a page.

  | 
| [WP_REST_Server::serve_request()](https://developer.wordpress.org/reference/classes/wp_rest_server/serve_request/)`wp-includes/rest-api/class-wp-rest-server.php` |

Handles serving a REST API request.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/rest_parse_embed_param/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.4.0](https://developer.wordpress.org/reference/since/5.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Frest_parse_embed_param%2F)
before being able to contribute a note or feedback.