wppaste
WordPress

get_embed_template(): string

Since
4.5.0
Source
wp-includes/template.php:602
Retrieves an embed template path in the current or parent template.

Description

The hierarchy for this template looks like: <ol> <li>embed-{post_type}-{post_format}.php</li> <li>embed-{post_type}.php</li> <li>embed.php</li> </ol> An example of this is: <ol> <li>embed-post-audio.php</li> <li>embed-post.php</li> <li>embed.php</li> </ol> The template hierarchy and template path are filterable via the '$type_template_hierarchy' and '$type_template' dynamic hooks, where $type is 'embed'.

Return

string
Full path to embed template file.

Uses · 3

Source

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

History

Introduced in 4.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.