- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Belgium
- Beta Tester
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 3-4 years
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.
<?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();
?>
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: http://screenr.com/liL
Do you guys have some good ideas of what you want to see in such a framework?
I’ve also posted this on Forrst.
- Attended a Community Meetup
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 3-4 years
- Item was Featured
- Most Wanted Bounty Winner
- Referred between 500 and 999 users
Looks like a great idea! Not sure I have any immediate ideas off the top of my head, but I can imagine this sort of thing being hugely useful when writing plugins.
Great work.
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Belgium
- Beta Tester
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 3-4 years
Thanks man. Will be releasing shortly my first item that uses this framework. After that I hope to release the framework here too.
- Attended a Community Meetup
- Author was Featured
- Bought between 50 and 99 items
- Exclusive Author
- Has been a member for 3-4 years
- Item was Featured
- Most Wanted Bounty Winner
- Referred between 500 and 999 users
Awesome
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Belgium
- Beta Tester
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 3-4 years
Just to let you know that the framework can now be downloaded from my Github page.
