diff --git src/wp-includes/template-loader.php src/wp-includes/template-loader.php
index 30626c8..68c66b1 100644
|
|
elseif ( is_feed() ) : |
39 | 39 | elseif ( is_trackback() ) : |
40 | 40 | include( ABSPATH . 'wp-trackback.php' ); |
41 | 41 | return; |
42 | | elseif ( is_embed() ) : |
43 | | $template = ABSPATH . WPINC . '/theme-compat/embed.php'; |
44 | | |
45 | | /** |
46 | | * Filter the template used for embedded posts. |
47 | | * |
48 | | * @since 4.4.0 |
49 | | * @since 4.5.0 The default template path changed to wp-includes/theme-compat/embed.php |
50 | | * |
51 | | * @param string $template Path to the template file. |
52 | | */ |
53 | | $template = apply_filters( 'embed_template', $template ); |
54 | | |
55 | | include ( $template ); |
56 | | return; |
57 | 42 | endif; |
58 | 43 | |
59 | 44 | if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) : |
60 | 45 | $template = false; |
61 | | if ( is_404() && $template = get_404_template() ) : |
| 46 | if ( is_embed() && $template = get_embed_template() ) : |
| 47 | elseif ( is_404() && $template = get_404_template() ) : |
62 | 48 | elseif ( is_search() && $template = get_search_template() ) : |
63 | 49 | elseif ( is_front_page() && $template = get_front_page_template() ) : |
64 | 50 | elseif ( is_home() && $template = get_home_template() ) : |
diff --git src/wp-includes/template.php src/wp-includes/template.php
index 315f2e8..032243a 100644
|
|
function get_single_template() { |
405 | 405 | } |
406 | 406 | |
407 | 407 | /** |
| 408 | * Retrieve path of embed template in current or parent template. |
| 409 | * By default the WordPress-template is returned. |
| 410 | * |
| 411 | * The template path is filterable via the dynamic {@see '$type_template'} hook, |
| 412 | * e.g. 'embed_template'. |
| 413 | * |
| 414 | * @since 4.5.0 |
| 415 | * |
| 416 | * @see get_query_template() |
| 417 | * |
| 418 | * @return string Full path to embed template file. |
| 419 | */ |
| 420 | function get_embed_template() { |
| 421 | $object = get_queried_object(); |
| 422 | |
| 423 | $templates = array(); |
| 424 | |
| 425 | if ( ! empty( $object->post_type ) ) { |
| 426 | $post_format = get_post_format( $object ); |
| 427 | if ( $post_format ) { |
| 428 | $templates[] = "embed-{$object->post_type}-{$post_format}.php"; |
| 429 | } |
| 430 | $templates[] = "embed-{$object->post_type}.php"; |
| 431 | } |
| 432 | |
| 433 | $templates[] = "embed.php"; |
| 434 | |
| 435 | return get_query_template( 'embed', $templates ); |
| 436 | } |
| 437 | |
| 438 | /** |
408 | 439 | * Retrieves the path of the singular template in current or parent template. |
409 | 440 | * |
410 | 441 | * The template path is filterable via the dynamic {@see '$type_template'} hook, |