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

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 1 09:28:52 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:               |
-------------------------+------------------------------

Comment (by trevogre):

 I think that I did that wrong. I'll have to lookup how to submit a patch
 and see if I did that right.

 The uploaded patch does the first two parts of this. Adds an option to
 store every shortcode that is added with modifications to add_shortcode.
 It stores the array with each shortcode pointing to a blank shortcode that
 returns only the content enclosed in the shortcode.

 This option is then loaded into $shortcode_tags when the file is loaded
 and each found run of add_shortcode replaces the blank function with it
 shortcode if the shortcode still exists.

 I hope this passes the elegance test. The only thing that concerns me is
 running update_option repeatedly. I'm not sure if that is doing a database
 call every time it runs but I would assume that it does.

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


More information about the wp-trac mailing list