Make WordPress Core

Ticket #34278: 34278.4.diff

File 34278.4.diff, 2.4 KB (added by swissspidy, 9 years ago)

New patch using embed.php

  • src/wp-includes/template-loader.php

    diff --git src/wp-includes/template-loader.php src/wp-includes/template-loader.php
    index 297b970..a758ed5 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 ) : 
    7764        else :
    7865                $template = get_index_template();
    7966        endif;
     67
    8068        /**
    8169         * Filter the path of the current template before including it.
    8270         *
  • src/wp-includes/template.php

    diff --git src/wp-includes/template.php src/wp-includes/template.php
    index b304e31..965e450 100644
    function get_attachment_template() { 
    466466}
    467467
    468468/**
     469 * Retrieve path of embed template in current or parent template.
     470 *
     471 * Checks for embed template in current template, if it exists or in the
     472 * parent template.
     473 *
     474 * The template path is filterable via the dynamic {@see '$type_template'} hook,
     475 * e.g. 'embed_template'.
     476 *
     477 * @since 4.5.0
     478 *
     479 * @see get_query_template()
     480 *
     481 * @return string Full path to embed template file.
     482 */
     483function get_embed_template() {
     484        $template = get_query_template( 'embed', array( 'embed.php' ) );
     485
     486        if ( '' === $template ) {
     487                $template = ABSPATH . WPINC . '/embed-template.php';
     488        }
     489
     490        return $template;
     491}
     492
     493/**
    469494 * Retrieve the name of the highest priority template file that exists.
    470495 *
    471496 * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which