[wp-trac] [WordPress Trac] #12982: Shortcodes don't allow shortcodes in attributes

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 12 22:31:17 UTC 2010


#12982: Shortcodes don't allow shortcodes in attributes
--------------------------+-------------------------------------------------
 Reporter:  Atoon         |       Owner:                       
     Type:  defect (bug)  |      Status:  new                  
 Priority:  normal        |   Milestone:  3.1                  
Component:  Shortcodes    |     Version:  3.0                  
 Severity:  normal        |    Keywords:  shortcode, attributes
--------------------------+-------------------------------------------------
 I think that shortcodes should work when used inside attributes of other
 shortcodes, just like they can work inside the "$content" of a shortcode.

 Some people says that that isn't supposed to work, but theoretically it is
 supposed to work when using the "do_shortcode" function. It don't work
 because:

 1) "do_shortcode" is context free, which it's actually fine by its
 fastness, although it don't allow stuff like inserting a shortcode inside
 the content of itself

 2) The shortcode regex stops with the first occurrence of a ] in a
 shortcode, so in this:

 {{{[foo bar="[baz /]"]content[/foo]}}}


 it "outputs":


 {{{[foo bar="[baz /]}}}


 and {{{"]content[/foo]}}} is ignored.

 I'm not programmer but I tried to fix it by changing the shortcode regex
 so it allow anything between quotes or brackets inside the first group of
 brackets. It sort of works, but also mess the handling of quotes in the
 rest of the shortcode, so I think something more advanced have to be done
 to make it work.

 This is somewhat related to another shortcode tickets, but none of them
 addresses nor solves this specifically.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12982>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list