WordPress.org

Make WordPress Core

Changeset 36648


Ignore:
Timestamp:
02/23/2016 08:22:41 PM (2 years ago)
Author:
swissspidy
Message:

Embeds: Only display an iframe when it was successfully loaded.

This prevents showing a blank iframe by first checking if a message was successfully received from it.

Fixes #35894.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-embed.js

    r35762 r36648  
    8787            return;
    8888        }
     89
    8990        loaded = true;
    9091
     
    9293            isIE11 = !!navigator.userAgent.match( /Trident.*rv:11\./ ),
    9394            iframes = document.querySelectorAll( 'iframe.wp-embedded-content' ),
    94             blockquotes = document.querySelectorAll( 'blockquote.wp-embedded-content' ),
    9595            iframeClone, i, source, secret;
    96 
    97         for ( i = 0; i < blockquotes.length; i++ ) {
    98             blockquotes[ i ].style.display = 'none';
    99         }
    10096
    10197        for ( i = 0; i < iframes.length; i++ ) {
    10298            source = iframes[ i ];
    103             source.style.display = '';
    10499
    105100            if ( source.getAttribute( 'data-secret' ) ) {
Note: See TracChangeset for help on using the changeset viewer.