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

WordPress Trac noreply at wordpress.org
Tue May 2 20:45:38 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 needs-testing  |     Focuses:  ui, accessibility
---------------------------------------+--------------------------------
Changes (by westonruter):

 * keywords:  needs-patch => needs-patch needs-testing


Comment:

 Visual text widget is further refined and ready for testing by checking
 out this pull request: https://github.com/xwp/wp-core-media-
 widgets/pull/97

 A few notes:

 * A new `widget_text_content` filter is introduced which applies on the
 `text` instance property with `wptexturize`, `wpautop`, `convert_smilies`,
 and `capital_P_dangit`… the filters for `the_content` which do not depend
 on there being a global post. Note that embeds and shortcodes are
 '''not''' processed.
 *  The `filter` property is removed from the widget instance when it is
 updated. The new `widget_text_content` filter applies after `widget_text`
 and it will only apply if the `filter` property is not set, so that the
 new filters will only apply once a user has touched a widget with the new
 TinyMCE editor active.
 * The feature plugin subclasses `WP_Widget_Text` whereas the core patch
 would actually modify the class itself.
 * In the customizer, changes to the visual editor get synced to the
 changeset and previewed after 1 second to reduce the amount of refreshes
 as changes are made (see also #38954).
 * TinyMCE is initialized when a widget control is expanded. Note there is
 currently a 100ms delay in initialization since `wp.editor.initialize()`
 seems to not enable `contenteditable` in the editor `iframe` when the
 `textarea` is not fully visible (such as while/before `slideDown`).
 * Every time you hit the Save button on the widget in the widgets admin
 screen, a flicker is currently noticeable as the TinyMCE editor has to be
 re-initialized. Ideally we could avoid this.

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


More information about the wp-trac mailing list