[wp-trac] [WordPress Trac] #34451: Embeds not working for non-WP sites
WordPress Trac
noreply at wordpress.org
Tue Oct 27 03:18:34 UTC 2015
#34451: Embeds not working for non-WP sites
----------------------------------------------------+--------------------
Reporter: swissspidy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.4
Component: Embeds | Version: trunk
Severity: major | Resolution:
Keywords: has-patch has-unit-tests needs-refresh | Focuses:
----------------------------------------------------+--------------------
Comment (by peterwilsoncc):
{{{#!js
iframes[ i ].src += '#?secret=' + secret;
iframes[ i ].setAttribute( 'data-secret', secret );
}}}
These lines will be a problem if multiple embeds are on one page, the
iframe URL will have the secret appended for each instance of the embed
code. A check for `data-secret` before appending should fix this.
if `data-secret` exists, you can also `continue;` as that increment of the
loop does not need to run.
{{{#!js
if ( !!iframes[ i ].getAttribute( 'security' ) && (isIE10 || isIE11) ) {
}}}
Worth reversing the attribute and IE check here, no need to look up the
DOM if not IE10-11.
Could also be worth overloading the selector to `iframe.wp-embedded-
content` to help avoid any coincidental hits.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34451#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list