[wp-hackers] Shortcodes and formatting

Andrew Ozz admin at laptoptips.ca
Wed Apr 2 01:36:13 GMT 2008

Mark Jaquith wrote:
> <!--[shortcode]--> would have been nice, because it is self-cleaning.  
> But it's probably too late to change it.  So let's not cry over spilled 
> milk.

Perhaps it is too late, although there are hardly any plugins at the 
moment that use shortcodes, and there will probably be lots of them in a 
few months. There are quite a few that use the "old" shortcode format 
too, like <!--plugin's special tag-->.

It's easy to use the current format in core, where the function that 
replaces the shortcode will always be present. But supporting plugins 
that use it brings some complications, especially for this type of 

[shortcode foo="bar"]
more content

where the content is different from post to post.

> Sidenote: we'd need to strip <p>\[$shortcode( .*?\]|\])</p> out, for 
> shortcodes entered on their own line.

Yes, something like that will have to be added to both js and php 
versions of wpautop. It will also have to support the above shortcode 
format too and treat it as <pre> tag, not changing anything inside.

More information about the wp-hackers mailing list