Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name:
- Description:
- Version: 0.1
- Author:
- Author URI:
- */
- if ( ! class_exists( 'plugin_name' ) ) {
- if ( function_exists( 'add_action' ) ) {
- add_action( 'plugins_loaded' , array( 'plugin_name', 'get_object' ) );
- }
- class plugin_name {
- /**
- * Class Object
- * @var object The Class Object
- */
- static private $classobj = NULL;
- /**
- * Gets the object, if it does not exists, init it
- */
- public function get_object () {
- if ( NULL === self :: $classobj ) {
- self :: $classobj = new self;
- }
- return self :: $classobj;
- }
- /**
- * Kick off
- */
- public function __construct () {
- // Actions
- $array = array(
- 'foo' => 'bar',
- 'baz' => 'boo'
- );
- if ( FALSE == $bar ) {
- // Do something
- }
- echo 'Foo: ' . $array[ 'foo' ] . '<br />';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement