Last active
August 29, 2015 14:26
-
-
Save jeremyfelt/9be8e21431a536d6f701 to your computer and use it in GitHub Desktop.
Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CLASS_NAME { | |
/** | |
* @var CLASS_NAME | |
*/ | |
private static $instance; | |
/** | |
* Maintain and return the one instance and initiate hooks when | |
* called the first time. | |
* | |
* @return \CLASS_NAME | |
*/ | |
public static function get_instance() { | |
if ( ! isset( self::$instance ) ) { | |
self::$instance = new CLASS_NAME; | |
self::$instance->load_plugins(); | |
} | |
return self::$instance; | |
} | |
/** | |
* Load "plugins" included with the theme. | |
*/ | |
public function load_plugins() { | |
// require_once( dirname( __FILE__ ) . '/includes/plugin-name.php' ); | |
} | |
} | |
add_action( 'after_setup_theme', 'CLASS_NAME' ); | |
/** | |
* Start things up. | |
* | |
* @return \CLASS_NAME | |
*/ | |
function CLASS_NAME() { | |
return CLASS_NAME::get_instance(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment