Make WordPress Core


Ignore:
Timestamp:
02/24/2016 08:56:18 PM (9 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/template-loader.php

    r36344 r36693  
    4141    return;
    4242elseif ( is_embed() ) :
    43     $template = ABSPATH . WPINC . '/embed-template.php';
     43    $template = ABSPATH . WPINC . '/theme-compat/embed.php';
    4444
    4545    /**
     
    4747     *
    4848     * @since 4.4.0
     49     * @since 4.5.0 The default template path changed to wp-includes/theme-compat/embed.php
    4950     *
    5051     * @param string $template Path to the template file.
Note: See TracChangeset for help on using the changeset viewer.