WordPress.org

Make WordPress Core

Ticket #34278: 34278.2.diff

File 34278.2.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..5432523 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 620d89d..26b8826 100644
    function get_comments_popup_template() { 
    488488}
    489489
    490490/**
     491 * Retrieve path of embed template in current or parent template.
     492 *
     493 * Checks for embed template in current template, if it exists or in the
     494 * parent template.
     495 *
     496 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     497 * e.g. 'embed_template'.
     498 *
     499 * @since 4.4.0
     500 *
     501 * @see get_query_template()
     502 *
     503 * @return string Full path to embed template file.
     504 */
     505function get_embed_template() {
     506        $template = get_query_template( 'embed', array( 'wp-embed.php' ) );
     507
     508        if ( '' === $template ) {
     509                $template = ABSPATH . WPINC . '/embed-template.php';
     510        }
     511
     512        return $template;
     513}
     514
     515/**
    491516 * Retrieve the name of the highest priority template file that exists.
    492517 *
    493518 * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which