WordPress.org

Make WordPress Core

Ticket #34278: 34278.3.diff

File 34278.3.diff, 2.4 KB (added by swissspidy, 4 years ago)
  • src/wp-includes/template-loader.php

    diff --git src/wp-includes/template-loader.php src/wp-includes/template-loader.php
    index d3eebe9..92e5916 100644
    elseif ( is_feed() ) : 
    3939elseif ( is_trackback() ) :
    4040        include( ABSPATH . 'wp-trackback.php' );
    4141        return;
    42 elseif ( is_embed() ) :
    43         $template = ABSPATH . WPINC . '/embed-template.php';
    44 
    45         /**
    46          * Filter the template used for embedded posts.
    47          *
    48          * @since 4.4.0
    49          *
    50          * @param string $template Path to the template file.
    51          */
    52         $template = apply_filters( 'embed_template', $template );
    53 
    54         include ( $template );
    55         return;
    5642endif;
    5743
    5844if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) :
    5945        $template = false;
    60         if     ( is_404()            && $template = get_404_template()            ) :
     46        if     ( is_embed()          && $template = get_embed_template()          ) :
     47        elseif ( is_404()            && $template = get_404_template()            ) :
    6148        elseif ( is_search()         && $template = get_search_template()         ) :
    6249        elseif ( is_front_page()     && $template = get_front_page_template()     ) :
    6350        elseif ( is_home()           && $template = get_home_template()           ) :
    if ( defined('WP_USE_THEMES') && WP_USE_THEMES ) : 
    7865        else :
    7966                $template = get_index_template();
    8067        endif;
     68
    8169        /**
    8270         * Filter the path of the current template before including it.
    8371         *
  • src/wp-includes/template.php

    diff --git src/wp-includes/template.php src/wp-includes/template.php
    index 45d1db0..4144a0d 100644
    function get_comments_popup_template() { 
    491491}
    492492
    493493/**
     494 * Retrieve path of embed template in current or parent template.
     495 *
     496 * Checks for embed template in current template, if it exists or in the
     497 * parent template.
     498 *
     499 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     500 * e.g. 'embed_template'.
     501 *
     502 * @since 4.4.0
     503 *
     504 * @see get_query_template()
     505 *
     506 * @return string Full path to embed template file.
     507 */
     508function get_embed_template() {
     509        $template = get_query_template( 'embed', array( 'embed-template.php' ) );
     510
     511        if ( '' === $template ) {
     512                $template = ABSPATH . WPINC . '/embed-template.php';
     513        }
     514
     515        return $template;
     516}
     517
     518/**
    494519 * Retrieve the name of the highest priority template file that exists.
    495520 *
    496521 * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which