[wp-trac] [WordPress Trac] #40907: Introduce widget dedicated for HTML code
WordPress Trac
noreply at wordpress.org
Tue Jul 18 19:47:16 UTC 2017
#40907: Introduce widget dedicated for HTML code
--------------------------------------+--------------------------
Reporter: westonruter | Owner: westonruter
Type: feature request | Status: reopened
Priority: normal | Milestone: 4.8.1
Component: Widgets | Version: 4.8
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+--------------------------
Comment (by westonruter):
Replying to [comment:64 bobbingwide]:
> Tests should be other way around
How so?
> the filter shouldn't be removed once added.
I disagree. If we just-in-time add a filter, we should just-in-time remove
it as well, to clean up after ourselves.
> Balancetags should be applied during save.
I don't disagree with you, but this is just following how the Text widget
is currently behaving. Somewhat strangely, there is actually an option
`use_balanceTags` that is by default `false` and there is ''no UI'' for
changing that. And when this option is false, then `balanceTags` does
nothing. So perhaps the `update` method for the Custom HTML widget should
in reality call the `force_balance_tags` function, but I think there is a
problem with it and that is why there is a user preference to begin with:
it can munge HTML, for example #39847. So I think we need a more reliable
HTML validator before we forcibly apply it unconditionally.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40907#comment:65>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list