Creating a WordPress Plugin

It wasn’t planned that way, but it turned out that I had to write a WordPress plugin myself to solve a problem. I want to have a Google Web Toolkit application run inside my blog. No big deal, but I couldn’t accomplish one tiny detail. GWT applications need a meta tag with the name gwt:module in the page header section. How do I manage to get this meta tag up there whenever a post includes a GWT application?

First, I looked for help where all the WordPress plugins/meta are listed. None of them seems to solve my problem. To be honest, I only looked at a few, so I really don’t know if I’ve overlooked the one I need. One Meta plugin came quite close to what I want, but it was for description and keywords only. Except that, it would have been perfect. So I took its idea and modified it.

You have to use WordPress’ custom fields for storing the gwt:module meta tags. Just create a new custom field when you create or edit a post. The key should be set to gwt:module, and the value should be the path and name of your GWT module. The plugin then collects all gwt:module meta tags for all posts on the page and puts them in the header section of the page.

Creating a custom field for a GWT-module

Later today, I will write a post that actually has a GWT application included.

1 comment… add one
  • Btw, another Wordpress Meta Plugin 1.9 is out, and you can insert custom (meta) tags in your header.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.