[wp-trac] [WordPress Trac] #19411: do_shortcode() runs before wpautop() in the text widget

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 2 07:59:28 UTC 2011


#19411: do_shortcode() runs before wpautop() in the text widget
------------------------------------+------------------
 Reporter:  nacin                   |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  high                    |   Milestone:  3.3
Component:  General                 |     Version:  3.3
 Severity:  major                   |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------

Comment (by westi):

 I don't think this will work after the first text widget with filters
 disabled because as far as I remember we process filters in the order they
 were added and therefore the following happens:

  * First widget with filters enabled - wpautop, shortcode_unautop,
 do_shortcode
  * Second widget with filters disabled - do_shortcode
  * Third widget with filters enabled - do_shortcode, wpautop,
 shortcode_unautop

 This is because when we re-add the filters they will end up behind
 do_shortcode in ordering.

 Alternative solutions to address this:
  * Run wpautop before the widget_text filter - screws over anyone that was
 expecting it to run afterwards
  * Also do the add remove dance with the do_shortcode filtering in the
 post widget_text add_filter second - so remove it, add the other two back
 and then add it again.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19411#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list