[wp-trac] [WordPress Trac] #35243: Extending the text widget to also allow visual mode

WordPress Trac noreply at wordpress.org
Wed Jan 11 20:20:22 UTC 2017

#35243: Extending the text widget to also allow visual mode
 Reporter:  paaljoachim  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.8
Component:  Widgets      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:

Comment (by westonruter):

 One more question regarding the Text widget: what should be done about the
 “Automatically add paragraphs” checkbox (the `filter` property)? It means
 whether `wpautop` is applied. But if it is a TinyMCE editor then really
 this means that shortcodes would need to be allowed and so really it needs
 to apply `the_content` filters which will include `wpautop` but also
 `wptexturize` and also `do_shortcode` among others. See previously
 reported in #10457 (Parse shortcodes in text widgets by default)… which is
 7 years old! But applying these other filters will likely have back-compat
 implications. Also, applying `the_content` filters may not work as
 expected always because the filters running will amy expect a `$post`
 global to be set which corresponds to the content being filtered.

 In any case, I think it only makes sense to show the `filter` checkbox
 when the non-visual editor is shown. We could employ a back-compat
 solution whereby we introduce a new `tinymce` property for the Text widget
 which gets set to `true` when the Visual editor is shown. If the property
 is `false` (or absent) then the HTML tab should be displayed instead,
 along with the `filter` checkbox displayed. Once you select the Visual
 tab, however, then `filter` would be implied to be `true` and the checkbox
 would be hidden. This will ensure that the Visual editor is opt-in when
 upgrading WP.

Ticket URL: <https://core.trac.wordpress.org/ticket/35243#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list