InScript
InScript is an extensible scripting framework that provides the capability to insert and modify data without needing to modify any WordPress files.
At the simplest level, it is a generic pattern matcher – it searches for specific patterns, or tags, and replaces them with something else. However, instead of replacing these patterns with static text, you can replace them with variables, functions, and even PHP code.
Some of the features that InScript provides are:
- Dynamic variables, which can be used in many places and are automatically updated (the version and last updated details above are dynamic variables)
- Disable WordPress texturize functions across the whole blog, individual posts, or even individual words
- Conversely, enable texturize, textile, markdown, or any formatting on individual posts or words
- Embed well-defined scripts inside posts and any other part of WordPress, without modifying the theme
The embedded scripts are very powerful, and allow you to do things like:
- Insert post & author information
- Add HTTP meta-values and make them post-specific
- Customise the appearance of words, paragraphs, or posts
- Change date formats on individual sections
- Insert highlighted code
- Insert custom PHP code
- Add custom stylesheets for specific posts
Because of the extensible nature of the plugin, you can add ‘scriptlets’ (mini-plugins) that provide extra features and yet use the same InScript framework.
Here are the current scriptlets:
- rss-link-list.zip - embed RSS feeds in conjunction with the rssLinkList plugin (which must be installed and enabled)
- pinyin-converter.zip - Pinyin converter allows Chinese pinyin to be inserted in the form zhong1guo2 and converted to the correct tonal version of %%lang_pinyin [text=zhong1guo2]%%
Note: install scriptlets into the /wp-content/plugins/inscript/scripts directory.
No really, what does it do?
The best way to explain what InScript does is by providing examples. Note that these examples are provided 'live' by InScript.
Example 1 – Code highlighting
Often you want to highlight some code within a post. This creates several problems:
- Code uses special characters that interfere with HTML
- WordPress mangles a lot of the characters
- It’s a chore to color the code by hand
We can insert an InScript tag to do all this for us.
And this produces:
Example 2 – Blog title & description
Notice anything special about the title of this page? No? Okay, go and look at it again. Yes, that's right, it's different from the rest of the blog. This is because of these two custom fields:
inscript_option_blogname = SuburbanGiraffe
More fun
Of course, all of these are simplistic examples. Separate plugins already exist to achieve many of the functions described here. The point is that InScript gives you the ability to perform these functions anywhere in your blog, using just one syntax and one plugin. Additionally, you can customise the output exactly as you want, using a wider range of functions. You can cook up all sorts of madness – now, who’s for colour-highlighted code in their title?
Before I finish, here are some more live functions:
- Word shuffle - %%str_shuffle [text=my old man is a dustman and he likes giraffes]%%
- Reverse - %%str_reverse [text=hello world and welcome to my plugin]%%
- Rot13 - %%str_rot13 [text=hello world and welcome to my plugin]%%
- Leet - %%str_leet [text=hello world and welcome to my plugin]%%
- Email obsfucator - %%str_obscure_email [email=test.email@example.com]%%
- System info - %%system_os%% %%system_release%% %%system_version%% %%system_machine%%
- Time since - this page was created
(as opposed to %%post_date%%) - PHP version - %%php_version%%
- HTTP agent - your browser is %%http_agent%%
- WordPress version - %%blog_version%%
And here's the WordPress calendar function embedded into a post:






Comments (page 1 of 11)
Jun 19, 2005 8:20 pm
John,
I think I have found the problem. Your scriptlet calls the function "rssLink", not "rssLinkList". Therefore, this should read:
'%%rsslinklist [rss_feed_url=http://someplace.com/feed.xml] [num_items=3]%%'
Excellent plugin though!
Thanks for being part of the community!
Jun 19, 2005 11:17 am
John,
Sweet work on the scriptlet. Unfortunatley though, I get this error when trying to incorporated it into a page:
http://www.thespiderbox.com/test/
Your scriptlet is installed as you noted and the rssLinkList plugin (0.8.x) is installed and activated. Any thoughts?
Jun 17, 2005 3:02 pm
Johan: Yes, absolutley - InScript will not delete or change any other custom fields. You can disable HeadSpace, play around with InScript, and then re-enable HeadSpace and still have all your HeadSpace meta data.
Jun 17, 2005 1:34 pm
I don't quite get how this replaces the HeadSpace Plugin. I have inserted the metatags for all my posts and pages using head_description and head_keywords and I am a little bit afraid of losing all this work...
Because I already am using another plugin to enable the use of PHP in posts, I am very interested in subsituting this plugin and the headspace plugin with the Inscript plugin.
Can I safely disable the headspace plugin and install the Inscript plugin without losing the metatags I created?
Jun 16, 2005 3:23 pm
I've added the RSS Link List scriptlet to allow the use of the rssLinkList plugin with InScript - put it in the 'wp-content/plugins/inscript/scripts' directory. Note that the rssLinkList plugin must be installed and enabled, and the arguments are exactly the same as for the plugin. For example,
%%rsslinklist [rss_feed_url=http://someplace.com/feed.xml] [num_items=3]%%Jun 15, 2005 11:17 am
John,
I was wanting to execute this plugin: http://rawlinson.us/blog/?p=212
On certain posts and pages. Your plugin seems very powerful and I wasn't sure if this would be something that your plugin could execute or not.
Jun 15, 2005 8:23 am
Chris: Yes it could. I was intending to include a little scriptlet to do just that, with the intention of being able to display RSS/Flickr feeds. I didn't have the time to include it previously, but it is next on the list of things to do - watch this space!
Chad: I've not tried it with WP-Cache as I couldn't get it to work on my install. However, I see no reason why it shouldn't work. The only problem is that the results of InScript will be frozen at the moment the cache is taken. This may or may not be useful.
Jun 14, 2005 3:00 pm
How does this play with WP-Cache (or does it)? Most other dynamic-inline plugins I've seen don't play nicely with it.
Jun 14, 2005 10:26 am
Could this plugin be used to display an RSS feed on a post or page?
Jun 9, 2005 10:23 am
Amazing! Pretty powerful and useful. Will use. Thanks so much for creating it.
Leave a comment