[wp-trac] [WordPress Trac] #40993: WordPress is auto-generating a line break in my widgets

WordPress Trac noreply at wordpress.org
Sat Jul 15 11:21:55 UTC 2017


#40993: WordPress is auto-generating a line break in my widgets
--------------------------+----------------------
 Reporter:  sandduner350  |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Widgets       |     Version:  4.8
 Severity:  major         |  Resolution:  invalid
 Keywords:  2nd-opinion   |     Focuses:
--------------------------+----------------------

Comment (by bobbingwide):

 Replying to [comment:3 westonruter]:
 > The filter priorities probably need to be modified so that shortcodes
 are processed earlier than `wpautop`.

 It's the other way round. Shortcodes need to be processed after wpautop.

 This is a bit of a challenge for two reasons
 1. `widget_text` is invoked before `widget_text_content`
 2. We can't guarantee that `widget_text_content` gets invoked.

 Therefore I can't simply change the original code
 {{{
 add_filter('widget_text', 'do_shortcode' );
 }}}
 to
 {{{
 add_filter('widget_text_content', 'do_shortcode', 20 );
 }}}

 So I need to implement a different solution to disable the
 `widget_text_content` filter functions when shortcodes have been detected
 in the widget content.


 PS. There's a typo in the 23 May post; line beaks.

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


More information about the wp-trac mailing list