From 7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 7 Jan 2020 13:06:14 +0100 Subject: Added wordpress --- .../wp-includes/theme-compat/embed-content.php | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 srcs/wordpress/wp-includes/theme-compat/embed-content.php (limited to 'srcs/wordpress/wp-includes/theme-compat/embed-content.php') diff --git a/srcs/wordpress/wp-includes/theme-compat/embed-content.php b/srcs/wordpress/wp-includes/theme-compat/embed-content.php new file mode 100644 index 0000000..25a45f2 --- /dev/null +++ b/srcs/wordpress/wp-includes/theme-compat/embed-content.php @@ -0,0 +1,127 @@ + +
> + $data ) { + if ( $data['height'] > 0 && $data['width'] / $data['height'] > $aspect_ratio ) { + $aspect_ratio = $data['width'] / $data['height']; + $measurements = array( $data['width'], $data['height'] ); + $image_size = $size; + } + } + } + + /** + * Filters 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'; + + /** + * Filters 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 ( $thumbnail_id && 'rectangular' === $shape ) : + ?> + + + +

+ + + +

+ + + + + +
+ + + + +
+