Beispiel #1
0
 public static function get_instance()
 {
     if (!self::$instance) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }
 public static function log($message, $args, $object_id, $contexts, $user_id = null)
 {
     // Prevent inserting Excluded Context & Actions
     foreach ($contexts as $context => $action) {
         if (!MainWP_WP_Stream_Connectors::is_logging_enabled('contexts', $context)) {
             unset($contexts[$context]);
         } else {
             if (!MainWP_WP_Stream_Connectors::is_logging_enabled('actions', $action)) {
                 unset($contexts[$context]);
             }
         }
     }
     if (count($contexts) == 0) {
         return;
     }
     $class = get_called_class();
     return MainWP_WP_Stream_Log::get_instance()->log($class::$name, $message, $args, $object_id, $contexts, $user_id);
 }