[wp-trac] [WordPress Trac] #18558: Handling of dormant shortcodes is inelegant

WordPress Trac wp-trac at lists.automattic.com
Fri Sep 9 14:19:26 UTC 2011


#18558: Handling of dormant shortcodes is inelegant
-------------------------+------------------------------
 Reporter:  markjaquith  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Shortcodes   |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------------------

Comment (by aaroncampbell):

 [attachment:18558.diff] is a first pass at processing ALL shortcodes (not
 just registered ones) and passing any that aren't registered through a
 generic `unregistered_shortcode()` which just returns the content.  I'm
 sure it needs more work on the regex, but I threw a decent number of tests
 at it an it worked.  It basically considers the shortcode name to be the
 from right after the opening [ until the first space or ]

 One of the things I had to do was add the ability for `do_shortcode` to be
 able to process a single tag.  The reason is that the embed shortcode had
 a hack where it unregistered all shortcodes, ran `do_shortcode()` on the
 content, then re-registered all the shortcodes...just so that the embed
 shortcode could run before the rest.  Now it can just call `do_shortcode(
 $content, 'embed' )`.  We may want to consider making the second argument
 an array so you could process a group of shortcodes, but I'm not sure it's
 necessary.

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


More information about the wp-trac mailing list