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.php

    r35848 r36693  
    469469 * Retrieve the name of the highest priority template file that exists.
    470470 *
    471  * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
    472  * inherit from a parent theme can just overload one file.
     471 * Searches in the STYLESHEETPATH before TEMPLATEPATH and wp-includes/theme-compat
     472 * so that themes which inherit from a parent theme can just overload one file.
    473473 *
    474474 * @since 2.7.0
     
    490490            $located = TEMPLATEPATH . '/' . $template_name;
    491491            break;
     492        } elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {
     493            $located = ABSPATH . WPINC . '/theme-compat/' . $template_name;
     494            break;
    492495        }
    493496    }
Note: See TracChangeset for help on using the changeset viewer.