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 7 of 11)
Mar 20, 2006 2:09 am
Bearded: To change meta data in a specific post/page, make sure you have hooked 'wp_head' and then add a new custom field to the post (see page 10 of the doc) that looks something like:
inscript_wp_head = %%head_keywords [keywords=somekeywords]%%
Mar 20, 2006 12:56 am
You'll have to post that again (escaping any HTML entities), or email it to me, as WordPress has stripped out whatever it is you wrote!
Mar 18, 2006 10:47 pm
Oops..try again:
I want this:
//
but this is echoed:
//
(The last great than sign has been converted to it's entity reference)
Mar 18, 2006 10:39 pm
Whenever I try inserting this (using php_eval or echo):
//
it comes out like this:
//
Mar 5, 2006 2:56 am
Neat script, just installed in on wp2..
Mar 4, 2006 8:18 am
I read the complete manual, above replies and installed INSCRIPT. I wish this is a substitution of a number of plugins. But.. I am a novice wordpress user. I tried to use inscript for replacing the head_title (title of the page) for specific page. But I couldnot succeed. In the above Replies you refered Page 19 of instruction. I went there (manual p 19) but there is no example for my need. Will you please write the example here for novice people like me! I would be really thankful. (but pls don't direct me to HeadSpace. Because I want to change some more items for specific posts. like keywords, description, etc. which would help me for search engines. )
Jan 26, 2006 3:34 pm
Jens: Could it be that you haven't selected "Header Data" in the "Hooked Actions" section of the options page?
John: Great and useful plugin!
Jan 26, 2006 12:39 am
Hi John!

Yip, my code has been killed.
But I have read the manual before I posted... and I wonder if I have done something wrong... can you please send me a mail, so I can send a screenshot of my options to you? I dont know to debug otherwise...
Regards!
Jens
Jan 25, 2006 6:10 pm
Michael: It sounds like you'll need to create your own Inscript function to capture the HTML fragment. The best place to start is by copying an existing function, and changing the function name to be inscript_func_yourfunctionname. After that you'll have to insert the code to extract the HTML.
Jens: I think something may have been cut from your comment. To insert an HTML keyword you should take a look at page 19 of the guide. In the data section of your global keyword you should then insert something like is shown on the bottom of page 19.
Jan 25, 2006 7:19 am
Hi! I just installed InScript and I am happy about the flexibility of this plugin. I just started with reading the manual and tried to insert meta-tags to my blog, but it did not work.
I installed the plugin, left all in default. Then I went to "Create new global keyword".
I added to "Filter/Action": "wp_head"
And to "Data": ""
But nothing appeared in my blog-head.
Does anyone know, where to problem is?
Regards!
Jens
Leave a comment