diff --git a/wp-includes/embed-template.php b/wp-includes/embed-template.php
index 11af91c839..b2a38cb77f 100644
--- a/wp-includes/embed-template.php
+++ b/wp-includes/embed-template.php
@@ -1,202 +1,13 @@
-
- class="no-js">
-
-
-
- tag.
- *
- * @since 4.4.0
- */
- do_action( 'embed_head' );
- ?>
-
->
- $data ) {
- if ( $data['width'] / $data['height'] > $aspect_ratio ) {
- $aspect_ratio = $data['width'] / $data['height'];
- $measurements = array( $data['width'], $data['height'] );
- $image_size = $size;
- }
- }
- }
-
- /**
- * Filter the thumbnail image size for use in the embed template.
- *
- * @since 4.4.0
- *
- * @param string $image_size Thumbnail image size.
- */
- $image_size = apply_filters( 'embed_thumbnail_image_size', $image_size );
-
- $shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square';
-
- /**
- * Filter the thumbnail shape for use in the embed template.
- *
- * Rectangular images are shown above the title
- * while square images are shown next to the content.
- *
- * @since 4.4.0
- *
- * @param string $shape Thumbnail image shape. Either 'rectangular' or 'square'.
- */
- $shape = apply_filters( 'embed_thumbnail_image_shape', $shape );
- }
- ?>
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+include( ABSPATH . WPINC . '/theme-compat/embed.php' );
diff --git a/wp-includes/embed.php b/wp-includes/embed.php
index c29c15de29..9ab1caadf0 100644
--- a/wp-includes/embed.php
+++ b/wp-includes/embed.php
@@ -1046,3 +1046,29 @@ function print_embed_sharing_dialog() {
%s',
+ esc_url( home_url() ),
+ esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),
+ esc_url( get_site_icon_url( 64, admin_url( 'images/w-logo-blue.png' ) ) ),
+ esc_html( get_bloginfo( 'name' ) )
+ );
+
+ $site_title = '' . $site_title . '
';
+
+ /**
+ * Filter the site title HTML in the embed footer.
+ *
+ * @since 4.4.0
+ *
+ * @param string $site_title The site title HTML.
+ */
+ echo apply_filters( 'embed_site_title_html', $site_title );
+}
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index e6a6498876..3c9462f9af 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -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 );
}
/**
diff --git a/wp-includes/template-loader.php b/wp-includes/template-loader.php
index 45fd33e96b..30626c8868 100644
--- a/wp-includes/template-loader.php
+++ b/wp-includes/template-loader.php
@@ -40,12 +40,13 @@ elseif ( is_trackback() ) :
include( ABSPATH . 'wp-trackback.php' );
return;
elseif ( is_embed() ) :
- $template = ABSPATH . WPINC . '/embed-template.php';
+ $template = ABSPATH . WPINC . '/theme-compat/embed.php';
/**
* Filter the template used for embedded posts.
*
* @since 4.4.0
+ * @since 4.5.0 The default template path changed to wp-includes/theme-compat/embed.php
*
* @param string $template Path to the template file.
*/
diff --git a/wp-includes/template.php b/wp-includes/template.php
index b304e31a72..315f2e8d2a 100644
--- a/wp-includes/template.php
+++ b/wp-includes/template.php
@@ -468,8 +468,8 @@ function get_attachment_template() {
/**
* Retrieve the name of the highest priority template file that exists.
*
- * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
- * inherit from a parent theme can just overload one file.
+ * Searches in the STYLESHEETPATH before TEMPLATEPATH and wp-includes/theme-compat
+ * so that themes which inherit from a parent theme can just overload one file.
*
* @since 2.7.0
*
@@ -489,6 +489,9 @@ function locate_template($template_names, $load = false, $require_once = true )
} elseif ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
$located = TEMPLATEPATH . '/' . $template_name;
break;
+ } elseif ( file_exists( ABSPATH . WPINC . '/theme-compat/' . $template_name ) ) {
+ $located = ABSPATH . WPINC . '/theme-compat/' . $template_name;
+ break;
}
}
diff --git a/wp-includes/theme-compat/embed-404.php b/wp-includes/theme-compat/embed-404.php
new file mode 100644
index 0000000000..9516727664
--- /dev/null
+++ b/wp-includes/theme-compat/embed-404.php
@@ -0,0 +1,37 @@
+
+
diff --git a/wp-includes/theme-compat/embed-content.php b/wp-includes/theme-compat/embed-content.php
new file mode 100644
index 0000000000..63a55280c4
--- /dev/null
+++ b/wp-includes/theme-compat/embed-content.php
@@ -0,0 +1,116 @@
+
+ >
+ $data ) {
+ if ( $data['width'] / $data['height'] > $aspect_ratio ) {
+ $aspect_ratio = $data['width'] / $data['height'];
+ $measurements = array( $data['width'], $data['height'] );
+ $image_size = $size;
+ }
+ }
+ }
+
+ /**
+ * Filter the thumbnail image size for use in the embed template.
+ *
+ * @since 4.4.0
+ * @since 4.5.0 Added `$thumbnail_id` parameter.
+ *
+ * @param string $image_size Thumbnail image size.
+ * @param int $thumbnail_id Attachment ID.
+ */
+ $image_size = apply_filters( 'embed_thumbnail_image_size', $image_size, $thumbnail_id );
+
+ $shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square';
+
+ /**
+ * Filter the thumbnail shape for use in the embed template.
+ *
+ * Rectangular images are shown above the title while square images
+ * are shown next to the content.
+ *
+ * @since 4.4.0
+ * @since 4.5.0 Added `$thumbnail_id` parameter.
+ *
+ * @param string $shape Thumbnail image shape. Either 'rectangular' or 'square'.
+ * @param int $thumbnail_id Attachment ID.
+ */
+ $shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );
+
+ if ( 'rectangular' === $shape ) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+