diff --git src/wp-includes/embed-template.php src/wp-includes/embed-template.php index fab8c84..54608df 100644 --- src/wp-includes/embed-template.php +++ src/wp-includes/embed-template.php @@ -10,193 +10,18 @@ * @since 4.4.0 */ -if ( ! headers_sent() ) { - header( 'X-WP-embed: true' ); -} +get_header( 'embed' ); -?> - - class="no-js"> - - <?php echo wp_get_document_title(); ?> - - 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 ); - } - ?> -
> - - - - -

- - - -

- - - - -
- - - - -
- -
-

-
-

- ' . esc_html( get_bloginfo( 'name' ) ) . '' - ); - ?> -

-
+else : - -
- - - +get_footer( 'embed' ); diff --git src/wp-includes/embed.php src/wp-includes/embed.php index cdeaf79..59b3b88 100644 --- src/wp-includes/embed.php +++ src/wp-includes/embed.php @@ -1046,3 +1046,111 @@ function print_embed_sharing_dialog() { $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' === $type && $shape === $type ) : ?> + + + + %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 src/wp-includes/general-template.php src/wp-includes/general-template.php index 1669ae3..d2624b8 100644 --- src/wp-includes/general-template.php +++ src/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 src/wp-includes/template.php src/wp-includes/template.php index b304e31..315f2e8 100644 --- src/wp-includes/template.php +++ src/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 src/wp-includes/theme-compat/embed-404.php src/wp-includes/theme-compat/embed-404.php new file mode 100644 index 0000000..9516727 --- /dev/null +++ src/wp-includes/theme-compat/embed-404.php @@ -0,0 +1,37 @@ + +
+

+ +
+

+ ' . esc_html( get_bloginfo( 'name' ) ) . '' + ); + ?> +

+
+ + + + +
diff --git src/wp-includes/theme-compat/embed-content.php src/wp-includes/theme-compat/embed-content.php new file mode 100644 index 0000000..7d9eecc --- /dev/null +++ src/wp-includes/theme-compat/embed-content.php @@ -0,0 +1,61 @@ + +
> + + +

+ + + +

+ + + +
+ + + + +
+ + + diff --git src/wp-includes/theme-compat/header-embed.php src/wp-includes/theme-compat/header-embed.php new file mode 100644 index 0000000..a95bdb3 --- /dev/null +++ src/wp-includes/theme-compat/header-embed.php @@ -0,0 +1,33 @@ + + + class="no-js"> + + <?php echo wp_get_document_title(); ?> + + tag. + * + * @since 4.4.0 + */ + do_action( 'embed_head' ); + ?> + +>