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 6 of 11)
Jan 20, 2006 7:06 pm
OK, I'm missing something.
I'm trying to get InScript to embed a html fragment from another site into a page on my WP. The idea is that my WP page supplies:
and then the ouside html fragment file supplies:
Boise, June 10th
Boston, June 11th
Butte, June 12
all nicely inlined html, then on to the next entry with it's inlined html fragment from a different site, etc.
However, there is some basic "ah-ha" I'm missing on getting this to work, in all the features I'm not putting together func & url together conceptually. Any pointers to get me on the right page?
Jan 9, 2006 6:00 pm
Lois: The zip you downloaded should contain an inscript.php and an inscript directory. Both of these need to be uploaded into the plugins directory
Jan 8, 2006 8:31 pm
Is there supposed to be an inscript.php in the zip? I dropped the inscript folder into my plugins directory and it doesn't show up in my plugins manager. But there was no inscript.php in the downloaded package.
Dec 1, 2005 12:40 am
Hi John,
when I wrote my first post here on November 19th, 2005 at 12:01 pm I just gave up with your Inscript plugin and installed Headspace. It works and I can add meta tags like description and keywords to each new of my posts and pages, but not to my homepage as the opening page of my site. How can I do this only for the homepage, not to overwrite the posts and pages?
If I "update" to Inscript would the meta-tags I set with HeadSpace stay on the posts and pages I have created before with HeadSpace? I would like to go on trying to install Inscript, but I am afraid that all my "old" posts and pages have to be rebuild again.
Thank you!
Nov 25, 2005 5:57 pm
Not just yet, but hopefully in a new release I'll correct this slip!
Nov 23, 2005 1:00 am
Hi,
Is there anyway to echo %% (from within a function block) without InScript parsing it? Eg. I want to echo %%bloginfo%%, but InScript parses it and I end up getting:
-- no func bloginfo --
Thanks.
Nov 22, 2005 1:51 am
Hi Chris,
To get meta tags you will need to enable 'Header data (wp_head)' in Hooked Actions. Then follow the instructions at the bottom of page 19 of the guide. You could also look at another plugin I wrote called HeadSpace, which does the same thing but is only targetted at meta tags and so is much easier to use.
Nov 19, 2005 12:01 pm
Hi,
I am looking for a wp-plugin to have meta tags like title and description on each post not having the title and description of the homepage but those from each post.
I put your inscript to my wp plugin-folder and activated it.
In options-inscript I do not know what to do, what to activate? What code to put on what place?
Sorry about my bad English. I am not a developer. Do I have to put code in the index.php?
Can you help me? With words a non-developer can understand.
Nov 11, 2005 1:56 am
Hi Alex, there's an example of setting keywords and description on page 19 of the PDF. You'll need to hook 'wp_head', so make sure that is enabled.
Nov 10, 2005 1:33 pm
I am a big fan of your headspace plug-in not only for its functionality but also it's ease of use. I have installed the InScript plug-in and am having a very hard time getting the headspace equivalents of "head_keywords" and "head_description" to work. I've tested the InScript plug-in and made sure it works. I was able to implement Example 4 of the documentation after adding more Hooks. Is there a hook that I'm missing that isn't listed in the codex? I think a lot of people who would like to shift from HeadSpace to InScript could use an example of how to make a smooth transition.
Leave a comment