wordpress_pluginRebol Tutorial is powered by Wordpress and my intent in the future would be to create some wordpress plugins. I’m neither a PHP nor a Wordpress Guru so I have decided to create a Rebol Wizard Script which will help me automate the creation of Wordpress Plugin skeleton. As a simple starter, here’s the code which will create the Wordpress Plugin Header (next installment will see improvment of features, also for a good tutorial see ditio’s article “How to Create a Wordpress Plugin from scratch” or “A Crash-Course in WordPress Plugin Development”):


Rebol [
    Title: "Wordpress Plugin Creation Online"
    Date:  12-Jun-2009
    File:  %wordpressplugin.r
    Purpose: {
        Automate the process of
        Wordpress Plugin Creation.
    }
]

Rebol-Plugin-Template: {/*
Plugin Name: <%Plugin-Name%>
Plugin URI: <%Plugin-URI%>
Description: <%Description%>
Author: <%Author%>
Version: <%Version%>
Author URI: <%Author-URI%>
*/
}

Plugin-Name: ask "Plugin-Name: "
Plugin-URI: ask "Plugin-URI: "
Description: ask "Description: "
Author: ask "Author: "
Version: ask "Version: "
Author-URI: ask "Author-URI: "

Plugin-Code: build-markup Rebol-Plugin-Template
Write/Lines Clipboard:// Plugin-Code

The secret of the code above resides in the Build-Markup function which will replace all variable names between <%%> (like <%Plugin-Name%>) by its value.

Copy and paste the code above into notepad and save it under the name wordpressplugin.r for example. Then execute it by double-clicking on it or in Rebol Console. You can also execute it remotely by typing in Rebol Console (see how-to here):


do http://reboltutorial.com/source/wordpressplugin.r

Answer to the questions like in the screen below:

Wordpress Plugin Rebol

Then paste the php code into Notepad:

Wordpress Plugin Rebol[sniplet name]

Bookmark and Share

Recent Articles