Edit File by line
/home/barbar84/www/wp-inclu.../theme-co...
File: embed-content.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Contains the post embed content template part
[2] Fix | Delete
*
[3] Fix | Delete
* When a post is embedded in an iframe, this file is used to create the content template part
[4] Fix | Delete
* output if the active theme does not include an embed-content.php template.
[5] Fix | Delete
*
[6] Fix | Delete
* @package WordPress
[7] Fix | Delete
* @subpackage Theme_Compat
[8] Fix | Delete
* @since 4.5.0
[9] Fix | Delete
*/
[10] Fix | Delete
?>
[11] Fix | Delete
<div <?php post_class( 'wp-embed' ); ?>>
[12] Fix | Delete
<?php
[13] Fix | Delete
$thumbnail_id = 0;
[14] Fix | Delete
[15] Fix | Delete
if ( has_post_thumbnail() ) {
[16] Fix | Delete
$thumbnail_id = get_post_thumbnail_id();
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
if ( 'attachment' === get_post_type() && wp_attachment_is_image() ) {
[20] Fix | Delete
$thumbnail_id = get_the_ID();
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Filters the thumbnail image ID for use in the embed template.
[25] Fix | Delete
*
[26] Fix | Delete
* @since 4.9.0
[27] Fix | Delete
*
[28] Fix | Delete
* @param int $thumbnail_id Attachment ID.
[29] Fix | Delete
*/
[30] Fix | Delete
$thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );
[31] Fix | Delete
[32] Fix | Delete
if ( $thumbnail_id ) {
[33] Fix | Delete
$aspect_ratio = 1;
[34] Fix | Delete
$measurements = array( 1, 1 );
[35] Fix | Delete
$image_size = 'full'; // Fallback.
[36] Fix | Delete
[37] Fix | Delete
$meta = wp_get_attachment_metadata( $thumbnail_id );
[38] Fix | Delete
if ( ! empty( $meta['sizes'] ) ) {
[39] Fix | Delete
foreach ( $meta['sizes'] as $size => $data ) {
[40] Fix | Delete
if ( $data['height'] > 0 && $data['width'] / $data['height'] > $aspect_ratio ) {
[41] Fix | Delete
$aspect_ratio = $data['width'] / $data['height'];
[42] Fix | Delete
$measurements = array( $data['width'], $data['height'] );
[43] Fix | Delete
$image_size = $size;
[44] Fix | Delete
}
[45] Fix | Delete
}
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
/**
[49] Fix | Delete
* Filters the thumbnail image size for use in the embed template.
[50] Fix | Delete
*
[51] Fix | Delete
* @since 4.4.0
[52] Fix | Delete
* @since 4.5.0 Added `$thumbnail_id` parameter.
[53] Fix | Delete
*
[54] Fix | Delete
* @param string $image_size Thumbnail image size.
[55] Fix | Delete
* @param int $thumbnail_id Attachment ID.
[56] Fix | Delete
*/
[57] Fix | Delete
$image_size = apply_filters( 'embed_thumbnail_image_size', $image_size, $thumbnail_id );
[58] Fix | Delete
[59] Fix | Delete
$shape = $measurements[0] / $measurements[1] >= 1.75 ? 'rectangular' : 'square';
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* Filters the thumbnail shape for use in the embed template.
[63] Fix | Delete
*
[64] Fix | Delete
* Rectangular images are shown above the title while square images
[65] Fix | Delete
* are shown next to the content.
[66] Fix | Delete
*
[67] Fix | Delete
* @since 4.4.0
[68] Fix | Delete
* @since 4.5.0 Added `$thumbnail_id` parameter.
[69] Fix | Delete
*
[70] Fix | Delete
* @param string $shape Thumbnail image shape. Either 'rectangular' or 'square'.
[71] Fix | Delete
* @param int $thumbnail_id Attachment ID.
[72] Fix | Delete
*/
[73] Fix | Delete
$shape = apply_filters( 'embed_thumbnail_image_shape', $shape, $thumbnail_id );
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
if ( $thumbnail_id && 'rectangular' === $shape ) :
[77] Fix | Delete
?>
[78] Fix | Delete
<div class="wp-embed-featured-image rectangular">
[79] Fix | Delete
<a href="<?php the_permalink(); ?>" target="_top">
[80] Fix | Delete
<?php echo wp_get_attachment_image( $thumbnail_id, $image_size ); ?>
[81] Fix | Delete
</a>
[82] Fix | Delete
</div>
[83] Fix | Delete
<?php endif; ?>
[84] Fix | Delete
[85] Fix | Delete
<p class="wp-embed-heading">
[86] Fix | Delete
<a href="<?php the_permalink(); ?>" target="_top">
[87] Fix | Delete
<?php the_title(); ?>
[88] Fix | Delete
</a>
[89] Fix | Delete
</p>
[90] Fix | Delete
[91] Fix | Delete
<?php if ( $thumbnail_id && 'square' === $shape ) : ?>
[92] Fix | Delete
<div class="wp-embed-featured-image square">
[93] Fix | Delete
<a href="<?php the_permalink(); ?>" target="_top">
[94] Fix | Delete
<?php echo wp_get_attachment_image( $thumbnail_id, $image_size ); ?>
[95] Fix | Delete
</a>
[96] Fix | Delete
</div>
[97] Fix | Delete
<?php endif; ?>
[98] Fix | Delete
[99] Fix | Delete
<div class="wp-embed-excerpt"><?php the_excerpt_embed(); ?></div>
[100] Fix | Delete
[101] Fix | Delete
<?php
[102] Fix | Delete
/**
[103] Fix | Delete
* Prints additional content after the embed excerpt.
[104] Fix | Delete
*
[105] Fix | Delete
* @since 4.4.0
[106] Fix | Delete
*/
[107] Fix | Delete
do_action( 'embed_content' );
[108] Fix | Delete
?>
[109] Fix | Delete
[110] Fix | Delete
<div class="wp-embed-footer">
[111] Fix | Delete
<?php the_embed_site_title(); ?>
[112] Fix | Delete
[113] Fix | Delete
<div class="wp-embed-meta">
[114] Fix | Delete
<?php
[115] Fix | Delete
/**
[116] Fix | Delete
* Prints additional meta content in the embed template.
[117] Fix | Delete
*
[118] Fix | Delete
* @since 4.4.0
[119] Fix | Delete
*/
[120] Fix | Delete
do_action( 'embed_content_meta' );
[121] Fix | Delete
?>
[122] Fix | Delete
</div>
[123] Fix | Delete
</div>
[124] Fix | Delete
</div>
[125] Fix | Delete
<?php
[126] Fix | Delete
[127] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function