[wp-trac] [WordPress Trac] #40951: New Text Widget - Switching Between Visual/Text Editor Strips Out Code

WordPress Trac noreply at wordpress.org
Tue Jul 18 19:55:00 UTC 2017


#40951: New Text Widget - Switching Between Visual/Text Editor Strips Out Code
-------------------------------------------------+-------------------------
 Reporter:  dwrippe                              |       Owner:
     Type:  defect (bug)                         |  westonruter
 Priority:  normal                               |      Status:  closed
Component:  Widgets                              |   Milestone:  4.8.1
 Severity:  major                                |     Version:  4.8
 Keywords:  needs-testing has-unit-tests has-    |  Resolution:  fixed
  patch commit fixed-major needs-dev-note        |     Focuses:
-------------------------------------------------+-------------------------

Comment (by westonruter):

 Replying to [comment:158 bobbingwide]:
 > I think the code should determine the value for legacy during save and
 then make allowances for it when deciding what filters to apply when
 formatting. If 'legacy' has been set then don't apply wpautop.
 >
 > In this scenario, when displaying the form for the text widget,
 'content' trumps 'legacy'.

 The reason for having both a `filter=content` property and a `legacy=1`
 property are for backwards-compatibility and because we can only store a
 boolean value in `filter` when in legacy mode. When `filter` is set to
 `content`, it already knows it is not in legacy mode because legacy mode
 would only ever store a boolean value in the property. In the visual
 editor, the filter property is not used and is only set to `content` to
 indicate essentially that the the “content” filters apply.

 > BTW. I don't particularly care for the term 'legacy'. Why not try
 something like 'complex' or 'mixed'?

 It's legacy because it is only there for backwards-compatibility. New
 installs will never encounter it. It will be like Links in WordPress: it's
 still there, but it is only shown if an install has been around for a long
 time.

 > You mean apply balancetags? If used at all this should be applied during
 save.

 Let's continue this on #40907. I've replied to you about that at
 https://core.trac.wordpress.org/ticket/40907#comment:65

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40951#comment:160>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list