[wp-trac] [WordPress Trac] #42203: Ensure media & embeds in Text widget are styled properly across widget areas in bundled themes
WordPress Trac
noreply at wordpress.org
Thu Oct 19 01:08:50 UTC 2017
#42203: Ensure media & embeds in Text widget are styled properly across widget
areas in bundled themes
----------------------------+----------------------------
Reporter: westonruter | Owner: davidakennedy
Type: task (blessed) | Status: assigned
Priority: high | Milestone: 4.9
Component: Bundled Theme | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
----------------------------+----------------------------
Comment (by joemcgill):
Replying to [comment:11 westonruter]:
> What if the `width` were to be injected into the embeds? We currently
have [https://github.com/WordPress/wordpress-
develop/blob/adfa4cd450831fcb96705a7dff94eafb3564e8ef/src/wp-
includes/widgets/class-wp-widget-text.php#L295-L318 logic] in the Text
widget to basically override the width that an embed may explicitly
provide. But it isn't providing //something// in return.
This logic seems ok when all we're expecting to pass to the callback is an
instance of a media embed, for which that particular logic seemed to be
written. In the text widget, however, it seems to apply much too widely,
trying to match any HTML element included in the text widget.
A possible approach here might be to try and add a wrapping `div` around
iframes that appear to contain videos. That said, it's worth noting that
if you remove the `inject_video_max_width_style` logic from the text
widget, the same max-width issues that affect the text widget also seem to
apply to videos included in content, unless handled by the theme. I think
that's a much better situation than Core trying to over-engineer a
solution here.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42203#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list