diff --git a/src/wp-includes/js/wp-embed-template.js b/src/wp-includes/js/wp-embed-template.js index 60ea47d387..2960991cee 100644 --- a/src/wp-includes/js/wp-embed-template.js +++ b/src/wp-includes/js/wp-embed-template.js @@ -138,6 +138,11 @@ */ sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) ); + // Send the document's height again after the featured image has been loaded. + document.querySelector( '.wp-embed-featured-image img' ).addEventListener( 'load', function() { + sendEmbedMessage( 'height', Math.ceil( document.body.getBoundingClientRect().height ) ); + } ); + /** * Detect clicks to external (_top) links. */