Wordpress OO plugin framework

Sitebase

Wim Mostmans

2 years ago · 1,301 views
<?php

/*
Plugin Name: Custom plugin
Plugin URI: http://www.sitebase.be
Description: Description
Author: Sitebase
Version: 1.0
Requires at least: 2.8
Author URI: http://www.sitebase.be
*/
include "library/My_WPBase.php";

class CustomPlugin extends My_WpBase{
	
	const NAME = "My Custom Plugin";
	
	public function activate(){
		echo 'activate';
	}
	
	public function deactivate(){
		echo 'deactivate';
	}
	
	public function filter_the_title($title){
		return $title . ' Modified :)';
	}
	
}

$CustomPlugin = new CustomPlugin();
Raw

I'm working on a OO framework that will make it super easy for writing Wordpress plugins. The framework will also give you much cleaner and manageable code.

Here you see a little example of a plugin written with the framework. The activate and deactivate are not needed but it's just for demonstrating how easy it is.

Instead of writing all kinds of add_action or add_filter rules you just overwrite the action/filter methods you want to use and you're ready to go.

This in combination with a lot of other usefull stuff will make this a very powerfull, and the first real OO Wordpress plugin framework.

Check out this little video to see the plugin in action: screenr.com/…

If you have some suggestions or tips, let me know.

Tagged: action filters framework oop php plugins programming wordpress
Comments are only visible to Forrst members. Log in or Request an invite.
3 new notifications