Make WordPress Core


Ignore:
Timestamp:
03/30/2016 10:56:44 AM (9 years ago)
Author:
swissspidy
Message:

Embeds: Improve how iframes are loaded after being initially hidden.

Use a more accessible way to initially hide the iframe. After that, only display an iframe when it was successfully loaded.

Merge of [36648] and [36708] to the 4.4 branch.

Fixes #35894.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4/src/wp-includes/embed.php

    r36060 r37093  
    777777    if ( ! empty( $content[1] ) ) {
    778778        // We have a blockquote to fall back on. Hide the iframe by default.
    779         $html = str_replace( '<iframe', '<iframe style="display:none;"', $html );
     779        $html = str_replace( '<iframe', '<iframe style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"', $html );
    780780        $html = str_replace( '<blockquote', '<blockquote class="wp-embedded-content"', $html );
    781781    }
     
    953953 */
    954954function _oembed_filter_feed_content( $content ) {
    955     return str_replace( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="display:none;"', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $content );
     955    return str_replace( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $content );
    956956}
    957957
Note: See TracChangeset for help on using the changeset viewer.