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

WordPress Trac noreply at wordpress.org
Tue Jul 4 23:18:09 UTC 2017


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

Comment (by westonruter):

 In [attachment:40951.4.diff] ([https://github.com/xwp/wordpress-
 develop/pull/235/files/d8cfffb..beb1c76 diff]) the legacy mode detection
 is expanded to also include whether or not shortcodes are present in the
 text, since if shortcodes get applied at `widget_text` then any HTML added
 could be corrupted by `wpautop` which then runs later at
 `widget_text_content`. Plugins that add shortcode support for the Text
 widget should use the `widget_text_content` filter at priority 11, in the
 same way that core applies shortcodes on the `the_content` filter at
 priority 11, whereas `wpautop` runs at priority 10.

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


More information about the wp-trac mailing list