Personal tools
You are here: Home Leocornus leocornus.tracclient WordPress Plugin First Peak

WordPress Plugin First Peak

The first peak at how to develop a WordPress plugin.

Minimium Files for a WordPress Plugin

WordPress will treat any PHP file with proper Plugin Information Header as a Plugin. So the minimium require for a WordPress plugin is a PHP file with some comments at the top.

<?php
/*
Plugin Name: WP Trac Client
Plugin URI: http://www.github.com/leocornus/leocornus.tracclient
Description: An XML-RPC trac client for WordPress blogs.
Version: 0.1
Author: Leocornus Ltd.
Author URI: http://www.leocorn.com
License: GPLv2
Network: True
*/

This PHP file will be called main PHP file for this plugin. Another import file readme.txt is must-have if we planed to host this plugin on WordPress Plugins Site.

Plugins Context: Blog and Network

For multisite mode WordPress instance, a plugin could be a network plugin or a blog plugin.

Confusion terms:

How to load other PHP files?

The quick answer is using the common way to load all PHP files.

We could use include_path to load Zend framework.

Admin Page on Dashboard

There are some WordPress functions we could use to add management pages on dashboard:

  • add_menu_page
  • add_submenu_page

How to present to end users?

This reladed to what's the different between Plugins and Themes. Widget might be the best choice. May be NOT!

Template and Template tag seems the winner at this time. Here is rough plan:

  • create feature enough template tags
  • provide the default template to using the template tags.
  • using shortcode to offer more options for end users.
Document Actions