[wp-trac] [WordPress Trac] #14481: Shortcode Enhancements

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 2 13:29:57 UTC 2010


#14481: Shortcode Enhancements
-------------------------+--------------------------------------------------
 Reporter:  deadowl      |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Shortcodes   |     Version:  3.0            
 Severity:  normal       |    Keywords:  has-patch      
-------------------------+--------------------------------------------------

Comment(by deadowl):

 Replying to [comment:6 scribu]:
 > Just took a quick look at your patch. Some nitpicking:

 Ready.

 >  You should use call_user_func() instead of $callback().

 Okay, I'll switch to using call_user_func.
 There was also a comment bug, and I kind of messed up shortcode_atts

 >  The patch should not contain all the notes about
 differences/improvements.

 Okay.

 > What exactly are the backwards incompatible changes?

 1. Uses entities/character references for escaping rather than C slashes.
 2. Standalone attributes (ex. {{{[sc hello]}}}) would evaluate to {{{hello
 => hello}}} rather than {{{0 => hello}}}. Additionally, {{{hello}}} is
 treated as a name rather than a value.
 3. Escaping a shortcode isn't a nested evaluation. An opening {{{[[}}}
 does not look for a closing {{{]]}}} on a matching tag. I consider this an
 improvement that avoids backtracking.
 4. Testing for {{{$content == null}}} no longer differentiates a shortcode
 as inline. This is to accommodate the ability to add multiple callbacks to
 a shortcode.
 5. No {{{shortcode_parse_atts()}}} function (which isn't mentioned in
 Shortcode API doc, but is in function reference).
 6. Limits attribute and tag names to matching
 {{{/[A-Za-z][-A-Za-z0-9_:.]*/}}}
 7. Limits unquoted attribute values to {{{/[-A-Za-z0-9_:.]+/}}}

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


More information about the wp-trac mailing list