# get_embed_template()

URL: https://chugunov.pro/api-wordpress/functions/get_embed_template/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 4.5.0.

## Сигнатура

```php
get_embed_template(): string
```

## Описание

The hierarchy for this template looks like:

- embed-{post_type}-{post_format}.php

- embed-{post_type}.php

- embed.php
An example of this is:

- embed-post-audio.php

- embed-post.php

- embed.php
The template hierarchy and template path are filterable via the [‘$type_template_hierarchy’](https://developer.wordpress.org/reference/hooks/type_template_hierarchy/) and [‘$type_template’](https://developer.wordpress.org/reference/hooks/type_template/) dynamic hooks, where `$type` is ’embed’.[See also](#see-also)
- [get_query_template()](https://developer.wordpress.org/reference/functions/get_query_template/)

## Возвращаемое значение

`string`

## Исходный код

Файл: `wp-includes/template.php:602`

```php
function get_embed_template() {
	$object = get_queried_object();

	$templates = array();

	if ( ! empty( $object->post_type ) ) {
		$post_format = get_post_format( $object );
		if ( $post_format ) {
			$templates[] = "embed-{$object->post_type}-{$post_format}.php";
		}
		$templates[] = "embed-{$object->post_type}.php";
	}

	$templates[] = 'embed.php';

	return get_query_template( 'embed', $templates );
}
```

## История изменений

- 4.5.0 — Introduced.

## Связанные

Использует: [`get_queried_object`](https://chugunov.pro/api-wordpress/functions/get_queried_object/), [`get_query_template`](https://chugunov.pro/api-wordpress/functions/get_query_template/), [`get_post_format`](https://chugunov.pro/api-wordpress/functions/get_post_format/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/get_embed_template/
