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

WordPress Trac noreply at wordpress.org
Mon Jul 17 08:12:54 UTC 2017


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

Comment (by bobbingwide):

 Replying to [comment:138 westonruter]:

 >
 > > 1. I don't understand why is_legacy_instance() is called during
 wp_list_widgets() processing. Note: It doesn't cause a problem at present.
 >
 > The reason is that the legacy mode is checked when outputting the widget
 controls, when the `form` method is invoked. The `form` method then will
 then decide whether or not the widget controls should be presented in
 legacy mode or not, and once a widget is saved in legacy mode or in non-
 legacy mode, then the results will get stored in the widget instance as
 the `legacy=true` prop or the `filter=content` prop, respectively. You can
 see that the `widget` method looks at the `filter` prop to see if has been
 set to `'content'`, and if so then that indicates that the new filter
 `widget_text_content` filter should apply.
 >

 I was referring to its invocation when displaying the Text widget in
 Available widgets, but now I see that the same logic's also used for
 Inactive widgets. So, I understand it's a necessary evil.

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


More information about the wp-trac mailing list