Commit 70d2cd8c authored by Erick Hitter's avatar Erick Hitter
Browse files

Yet more singleton implementation improvements.

parent da5b57fe
...@@ -57,11 +57,18 @@ class taxonomy_dropdown_widget_plugin { ...@@ -57,11 +57,18 @@ class taxonomy_dropdown_widget_plugin {
public static function get_instance() { public static function get_instance() {
if ( ! is_a( self::$__instance, __CLASS__ ) ) { if ( ! is_a( self::$__instance, __CLASS__ ) ) {
self::$__instance = new self; self::$__instance = new self;
self::$__instance->setup();
} }
return self::$__instance; return self::$__instance;
} }
/**
* Silence is golden!
*/
private function __construct() {}
/** /**
* Register actions and activation/deactivation hooks * Register actions and activation/deactivation hooks
* @uses add_action * @uses add_action
...@@ -69,7 +76,7 @@ class taxonomy_dropdown_widget_plugin { ...@@ -69,7 +76,7 @@ class taxonomy_dropdown_widget_plugin {
* @uses register_deactivation_hook * @uses register_deactivation_hook
* @return null * @return null
*/ */
protected function __construct() { protected function setup() {
add_action( 'widgets_init', array( $this, 'action_widgets_init' ) ); add_action( 'widgets_init', array( $this, 'action_widgets_init' ) );
register_activation_hook( __FILE__, array( $this, 'activation_hook' ) ); register_activation_hook( __FILE__, array( $this, 'activation_hook' ) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment