mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-16 23:00:21 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@36693 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -36,14 +36,13 @@ function get_header( $name = null ) {
|
||||
|
||||
$templates = array();
|
||||
$name = (string) $name;
|
||||
if ( '' !== $name )
|
||||
if ( '' !== $name ) {
|
||||
$templates[] = "header-{$name}.php";
|
||||
}
|
||||
|
||||
$templates[] = 'header.php';
|
||||
|
||||
// Backward compat code will be removed in a future release
|
||||
if ('' == locate_template($templates, true))
|
||||
load_template( ABSPATH . WPINC . '/theme-compat/header.php');
|
||||
locate_template( $templates, true );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,14 +75,13 @@ function get_footer( $name = null ) {
|
||||
|
||||
$templates = array();
|
||||
$name = (string) $name;
|
||||
if ( '' !== $name )
|
||||
if ( '' !== $name ) {
|
||||
$templates[] = "footer-{$name}.php";
|
||||
}
|
||||
|
||||
$templates[] = 'footer.php';
|
||||
$templates[] = 'footer.php';
|
||||
|
||||
// Backward compat code will be removed in a future release
|
||||
if ('' == locate_template($templates, true))
|
||||
load_template( ABSPATH . WPINC . '/theme-compat/footer.php');
|
||||
locate_template( $templates, true );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,9 +119,7 @@ function get_sidebar( $name = null ) {
|
||||
|
||||
$templates[] = 'sidebar.php';
|
||||
|
||||
// Backward compat code will be removed in a future release
|
||||
if ('' == locate_template($templates, true))
|
||||
load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php');
|
||||
locate_template( $templates, true );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user