函数原型
get_embed_template(): string
函数描述
Retrieves an embed template path in the current or parent template.
是否弃用
未弃用
函数参数
无
函数返回值
string Full path to embed template file.
函数位置
File: wp-includes/template.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 );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.5.0 | Introduced. |

