Пример #1
0
 public static function instance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 /**
  * Main Post_Views_Counter instance,
  * Insures that only one instance of Post_Views_Counter exists in memory at one time.
  * 
  * @return object
  */
 public static function instance()
 {
     if (!isset(self::$instance) && !self::$instance instanceof Post_Views_Counter) {
         self::$instance = new Post_Views_Counter();
         self::$instance->define_constants();
         add_action('plugins_loaded', array(self::$instance, 'load_textdomain'));
         self::$instance->includes();
         self::$instance->update = new Post_Views_Counter_Update();
         self::$instance->settings = new Post_Views_Counter_Settings();
         self::$instance->query = new Post_Views_Counter_Query();
         self::$instance->cron = new Post_Views_Counter_Cron();
         self::$instance->counter = new Post_Views_Counter_Counter();
         self::$instance->columns = new Post_Views_Counter_Columns();
         self::$instance->frontend = new Post_Views_Counter_Frontend();
         self::$instance->dashboard = new Post_Views_Counter_Dashboard();
         self::$instance->widgets = new Post_Views_Counter_Widgets();
     }
     return self::$instance;
 }