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