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

WordPress Trac wp-trac at lists.automattic.com
Sat Sep 10 02:43:21 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 trevogre):

 That's probably a good idea, but I see some issues with it.

 I didn't consider that because it seems like a feature to me to always
 show something on output of a newly entered shortcode that doesn't exist.
 So that when you preview you see that you got the shortcode wrong, or need
 to install the shortcode. The real feature enhancement seemed to be when a
 shortcode disappeared that you may have used in a ton of places. It would
 be a pain to go and clean your site to remove it everywhere and better to
 have it just not appear.

 Also, someone might want to use [] in their text, and so you are going to
 make them into completely special characters instead of special characters
 only in explicit circumstances.
 That could be very bad for backwards compatibility.

 It seems to me that that could/should be an option somewhere. Treat all
 text contained in [] as shortcodes.

 Combine that with the ability to set a default shortcode handler and you
 have a feature.

 You could write some interesting catch all default shortcode handlers with
 a bunch of switches. So maybe your default shortcode handler in your theme
 emulates a bunch of existing shortcodes that you might not have turned on.

 One thing that might be interesting is to global the current running
 shortcode so that you know which shortcode name is running.
 $current_shortcode_rendering. Then your default shortcode could switch its
 behavior based upon the shortcode name.

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


More information about the wp-trac mailing list