[wp-hackers] Shortcodes and formatting

Andrew Ozz admin at laptoptips.ca
Sun Apr 6 05:14:38 GMT 2008


Kimmo Suominen wrote:
> On Fri, Apr 04, 2008 at 01:22:01PM -0800, Andrew Ozz wrote:
>> That sounds like a very good idea. Then we can add a small filter to 
>> TinyMCE to replace <!--[ (but not <!--[CDATA[) with [ on loading and put 
>> it back on saving, so the shortcodes can be typed or pasted in visual 
>> mode too.
> 
> How would one type in [foo] in the visual editor then, without it turning
> into an HTML comment?

You're right. It would turn into a comment. It would be better to just 
replace the <!--[ and ]--> with &lt;!--[ and ]--&gt;. That would work fine.

However since this is a plugin related problem (or rather will be), 
logically a plugin should solve it. I've just made a small plugin to 
hide orphaned shortcodes. Give it a shortcode and it will insert an 
empty string in its place. Check it out here:
http://www.laptoptips.ca/projects/old-shortcodes/


More information about the wp-hackers mailing list