[wp-trac] [WordPress Trac] #10457: Parse shortcodes in text widgets by default

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 4 23:56:49 UTC 2011


#10457: Parse shortcodes in text widgets by default
-------------------------------------+-----------------------------
 Reporter:  ionfish                  |       Owner:  westi
     Type:  enhancement              |      Status:  reopened
 Priority:  normal                   |   Milestone:  Future Release
Component:  Widgets                  |     Version:  2.8
 Severity:  normal                   |  Resolution:
 Keywords:  westi-likes needs-patch  |
-------------------------------------+-----------------------------

Comment (by bobbingwide):

 Hi, I'd just like to say that I've done quite a bit of work on shortcodes
 in my plugin called oik.

 I wrote a set of functions that allow a shortcode to determine whether or
 not to expand depending on the value of the current filter. I've termed
 them smart shortcodes.

 There were quite a few gotchas...
 I had to write code to allow for the fact that do_shortcode could get
 invoked multiple times - catering for this by changing the '[' to &#91
 when it was not wise to expand the code.

 The wpautop()code has always been annoying, inserting unwanted breaks (<br
 />) in all sorts of places. My feeling is that it should NOT insert a
 break when the line ends with a shortcode ending.

 To overcome the current behaviour I often have to put shortcodes side by
 side in the content. This is especially bothersome when the shortcodes
 expand into <div>s, <span>s and/or other generated XHTML.

 I also had to add special code to support shortcode expansion in
 wp_footer, since current_filter() returns empty in this instance.

 To cut a long story short, I agree that more work needs to be done.

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


More information about the wp-trac mailing list