[wp-trac] [WordPress Trac] #18558: Handling of dormant shortcodes is inelegant
WordPress Trac
wp-trac at lists.automattic.com
Thu Sep 8 06:09:57 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):
Talked to trevgore in IRC. I recommended something like this:
On init retrieve option and register shortcodes. Since each shortcode tag
can only have 1 function attached anything registered after will
overwrite. Example code:
{{{
$old_shortcodes = get_option( 'old_shortcodes', array() );
foreach ( $old_shortcodes as $sc ) {
if ( $sc_not_registered_already )
add_shortcode( $sc, 'unregistered_shortcode' );
}
}}}
And then on shutdown load the option and merge the list of old shortcodes
with the current set and store the list back in the option.
I think trevgore is going to take another shot at the patch.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18558#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list