Opened 7 years ago
Last modified 7 years ago
#42695 new defect (bug)
Text Widget: hard-coded width/height attributes are stripped from iframes
Reported by: | dubaicarmelschool | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Widgets | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
hi when i update my WordPress 4.9 my exiting iframe size in text widget not working.please find my http://dubaicarmelschool.com/ and iframe code below:
<iframe src="sshow/show.html" border="0" width="700" height="400"style="border: 0; margin-left: -120px; margin-right: -0px; margin-top: -9px; margin-bottom: -0px;"></iframe>
Attachments (2)
Change History (23)
#1
@
7 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.9.2
The width
and height
are getting removed for the sake of getting embeds to resize properly. See [42001] and #42203.
I can see that this logic needs to be prevented for any elements that are hard-coded with dimensions. We need to limit the replacements to iframes and other media that come from external embeds
@dubaicarmelschool in the immediate term, please add your iframe
code to a Custom HTML widget instead. This will bypass the stripping of the width
and height
attributes.
#2
@
7 years ago
- Summary changed from Text in Widget to Text Widget: hard-coded width/height attributes are stripped from iframes
#3
@
7 years ago
The approach we take in a patch could be to replace all width/height attributes with placeholders prior to doing embeds, and then restore them after the embeds are done.
#4
@
7 years ago
The same thing happens whenever you paste a Google Calendar code into the code, eg.
<iframe src="thecalendar.google.comURL" style="border: 0" width="100%" height="600" frameborder="0" scrolling="no"></iframe>
Height is removed, iframe is not very big, as in that screenshot.
This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.
7 years ago
#6
@
7 years ago
I think what should be done is the following: any heights or widths in the original text should get replaced with placeholders before running the embed logic. Then after embedding logic is done, and the dimensions are stripped out, the placeholders can be swapped back with their original values. This will ensure any user-supplied dimensions are kept intact.
#8
@
7 years ago
I'm surprised there was no mention of using HEIGHT="NUMBER" in capitals to make the Wordpress match and replace not take away all the height. I would think this should be a top, bolded item in the release notes for wp4.9 - if you have iframe that you still want to have height, make sure you edit it and CAPITALIZE height after upgrading.
This ticket was mentioned in Slack in #core by desrosj. View the logs.
7 years ago
#11
@
7 years ago
At the very least shouldn't the release notes say users need to capitalize HEIGHT in iframes if they want to actually see it all?
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
7 years ago
#14
@
7 years ago
- Keywords has-patch dev-feedback added; needs-patch removed
Hi @westonruter
I tried a workaround for this ticket in 42695.diff
.
This patch clearly needs dev-feedback.
Cheers,
Jb
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
7 years ago
This ticket was mentioned in Slack in #core by desrosj. View the logs.
7 years ago
This ticket was mentioned in Slack in #core by desrosj. View the logs.
7 years ago
This ticket was mentioned in Slack in #core by desrosj. View the logs.
7 years ago
#21
@
7 years ago
Not seeing any mention of this in https://codex.wordpress.org/Version_4.9
If this is not changing there should be a note that every widget with an iframe tag should have capitalized height= if you want it to actually have height.
text widget iframe output