Remem­ber my first and only Word­Press plu­gin? Well it just got better.

Snips2

Snips 2.0 is basi­cally Snips rewrit­ten from scratch, updated to fit Word­Press’ Short­code API. Let’s see how good it is…

Tired of hav­ing to copy paste nasty HTML code from sites such as YouTube, Vimeo and so on? Look­ing for a way to insert recur­rent con­tent in your posts with­out hav­ing to type it every time? Would like to be able to inject para­me­ters in these snip­pets? Well, now you can.

Just install Snips and use the bun­dled short­codes or create/edit your own!

Each Snip is a com­bi­na­tion of a name, a model and optional para­me­ters. The name defines the short­code tag you will be able to use, the model is the con­tent that will replace your short­code calls and the para­me­ters (that look like #the-parameter# in the model) are por­tions of the model that can change from a call to an other. Those para­me­ters can have default val­ues or can be left empty and then become mandatory.

All of this can be edited via a sim­ple UI, found under Set­tings > Snips… Here’s screenshot:

Snips2 screenshot

For those that used Snips’ first ver­sion: (0.2) every­thing should be OK, the pre­vi­ous syn­tax will work ; but I rec­om­mend using the new one and the cor­re­spond­ing updated model files (ex: yt becomes yt2). Also, the #up# para­me­ter (used in mp3 and swf snips) has to be set man­u­ally to your blog’s upload path.

If you use it and find bugs, please let me know! This is the first time I use jQuery behav­ior (for the para­me­ters’ detec­tion in the Set­tings page) so it could act a lit­tle weird.