get_embed_template()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
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’ and ‘$type_template’ dynamic hooks, where $type is ’embed’.
Возвращаемое значение
string
Исходный код
wp-includes/template.php:602
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. |

