WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/24/2016 08:56:18 PM (5 years ago)
Author:
DrewAPicture
Message:

Embeds: Introduce embed templates into the template hierarchy via theme-compat.

Splits wp-includes/embed-template.php, introduced in 4.4, into five new templates that can be individually overridden by themes:

  • embed.php
  • embed-404.php
  • embed-content.php
  • header-embed.php
  • footer-embed.php

Also introduces a new template tag for outputting the site title, the_embed_site_title().

The five new templates live in theme-compat, allowing for graceful fallbacks should themes prefer not to override any or all of them.

Props swissspidy, imath, ocean90, DrewAPicture.
See #34561.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r36671 r36693  
    3737    $templates = array();
    3838    $name = (string) $name;
    39     if ( '' !== $name )
     39    if ( '' !== $name ) {
    4040        $templates[] = "header-{$name}.php";
     41    }
    4142
    4243    $templates[] = 'header.php';
    4344
    44     // Backward compat code will be removed in a future release
    45     if ('' == locate_template($templates, true))
    46         load_template( ABSPATH . WPINC . '/theme-compat/header.php');
     45    locate_template( $templates, true );
    4746}
    4847
     
    7776    $templates = array();
    7877    $name = (string) $name;
    79     if ( '' !== $name )
     78    if ( '' !== $name ) {
    8079        $templates[] = "footer-{$name}.php";
    81 
    82     $templates[] = 'footer.php';
    83 
    84     // Backward compat code will be removed in a future release
    85     if ('' == locate_template($templates, true))
    86         load_template( ABSPATH . WPINC . '/theme-compat/footer.php');
     80    }
     81
     82    $templates[]    = 'footer.php';
     83
     84    locate_template( $templates, true );
    8785}
    8886
     
    122120    $templates[] = 'sidebar.php';
    123121
    124     // Backward compat code will be removed in a future release
    125     if ('' == locate_template($templates, true))
    126         load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php');
     122    locate_template( $templates, true );
    127123}
    128124
Note: See TracChangeset for help on using the changeset viewer.