Make WordPress Core

Opened 3 years ago

Closed 25 hours ago

Last modified 25 hours ago

#23083 closed enhancement (fixed)

Tag balancing for text widgets

Reported by: mark-k Owned by: wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-patch
Focuses: Cc:


Based on inspecting the code it looks like tag balancing is not applied to th content of the text widget.

IMO people are more likely to produce broken HTML when adding HTML in a text widget then when writing post, but tag balancing is done only for posts and comments (in which HTML is rarely used).

Attachments (3)

23083.diff (469 bytes) - added by MikeHansenMe 3 years ago.
adds tag balancing to text widget
23083.2.diff (462 bytes) - added by MikeHansenMe 3 years ago.
uses balanceTags instead of force_balance_tags to make use optional
23083.3.diff (502 bytes) - added by MikeHansenMe 6 weeks ago.

Download all attachments as: .zip

Change History (11)

#1 @rachelbaker
3 years ago

  • Cc rachelbaker added

3 years ago

adds tag balancing to text widget

#2 follow-up: @MikeHansenMe
3 years ago

  • Cc mdhansen@… added

The patch only changes the way the code is displayed on the front. It does not alter the html input. There may need to be a similar js implementation.

#3 in reply to: ↑ 2 @mark-k
3 years ago

@MikeHansenMe, isn't it better to hook balanceTags to get the use_balanceTags option into play in case there are people that don't want balancing?

3 years ago

uses balanceTags instead of force_balance_tags to make use optional

#4 @MikeHansenMe
3 years ago

@mark-k I was thinking mostly of people copying code snippets without knowledge of the code. Perhaps we would be doing them a favor but in the end I think you are right. It should be optional.

#5 @MikeHansenMe
3 years ago

  • Keywords has-patch needs-testing added

#6 @MikeHansenMe
6 months ago

Patch still applies

6 weeks ago

#7 @wonderboymusic
25 hours ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 35103:

Widgets: add a default filter for widget_text (used by the Text widget), balanceTags, which respects the option for use_balanceTags.

Props MikeHansenMe.
Fixes #23083.

#8 @wonderboymusic
25 hours ago

  • Keywords needs-testing removed
  • Milestone changed from Awaiting Review to 4.4
Note: See TracTickets for help on using tickets.