Skip to content

Instantly share code, notes, and snippets.

@ericjuden
Created January 28, 2013 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericjuden/4656024 to your computer and use it in GitHub Desktop.
Save ericjuden/4656024 to your computer and use it in GitHub Desktop.
Object-Oriented Plugin for WordPress boilerplate
<?php
/**
* Plugin Name: My Object-Oriented Plugin
* Plugin URI: Plugin Website Here
* Description: Your Description Here
* Author: Your Name Here
* Author URI: Your Website Here
* Version: 1.0
*/
class My_Object_Oriented_Plugin {
function __construct(){
// Constructor...actions and filters go here
add_action('admin_init', array($this, 'admin_init'));
}
function admin_init(){
echo "This is a test";
}
}
// Create an instance of the class so it will run
$my_object_oriented_plugin = new My_Object_Oriented_Plugin();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment