
Introducing Snips, my first WordPress plugin!
Running a WordPress blog? Tired of having to switch to “code view” to copy/paste nasty HTML code from sites such as YouTube or DailyMotion? Or frequently having to write the same things?
Then Snips is for you!
What for?
- To avoid switching to “code view” to copy/paste nasty HTML code from sites like YouTube and DailyMotion (those that provide an “embed” option, but not only!)
- To be able to change all of these codes at once, from once place
- And much more!
How?
- Simply get the plugin archive (hosted at Google Code)
- Extract to your plugins directory
- Use! Here are some examples…
- To insert a YouTube video (in “visual” mode), simply write [yt:F4WKonOUxiI], nothing more!
- A DailyMotion one, write [dm:x3cmel]
- Virtually anything would work…
- Extend (if you want to!)
- Let’s say you want to manage Virb embedded videos
- Go to a Virb video page
- Copy the nasty “embed” code into a file called (for example) virb-model.txt and store it into your snips folder.
- Locate what might be different from one video to an other (in that example, this would be 2227/4Mi8niIFNu8G6iDALVOwzKgGayTDZJK9)
- Replace it with a simple #1# and save your file (watch out, it appears twice!). Here we are, you just created a new Snip! To embed a Virb video in a post, just write [virb:(the unique identifier)].
- Now suppose you would like to be able to change the size of the embedded object…
- Replace 564px with #2# and 380px with #3#. You’ve now defined 2 new variables, you can now add a Virb video and specify its dimensions like this: [virb:(the unique identifier),100%,400].
- What if you want default values for these variables?
- Add a new line with only 3 dashes (-) a the end of your text file
- Under this line add a new one with 2=100% and another with 3=400. You just specified the default values for parameters 2 and 3!
- The virb-model.txt file should now look like this:
<object height=”#3#” width=”#2#” type=”application/x-shockwave-flash” data=”http://www.virb.com/external/video/#1#”></p> <param name=”movie” value=”http://www.virb.com/external/video/#1#”></param> <param name=”quality” value=”best”></param> <param name=”wmode” value=”transparent”></param> <param name=”salign” value=”tl”></param> </object>
---
2=100%
3=400
How much?
- Free, dude!
- OpenSource, even…
If you use it and get into trouble, slap me ; drop a comment.

[...] 这里下载,还有更多的教程 [...]
Available on WordPress.org. yay!
Hello
nice site
Well, WP 2.5 is out now and has a feature called Shortcode.
Even if Snips’ syntax looks a lot like Snips’ one it has nothing to do with it!
Snips was done before 2.5 went out and might be ported to fit the new API but don’t expect it to work exactly the same until then.
C’est le plugin le plus simple d’utilisation et pourtant le plus intéressant que j’ai jamais essayé. Je suis en train de monter un blog “lab” dans ma boite et c’est exactement ce qu’il me fallait.
Bravo et merci !
Merci pour ce retour !
[...] using Snips and a Vimeo model [...]