/** * get_instance function * * Return singleton instance * * @return object **/ static function get_instance() { if (self::$_instance === NULL) { self::$_instance = new self(); } return self::$_instance; }
require_once "{$path}/class-{$class_name}.php"; } } } spl_autoload_register('nc_autoload'); /** * enable feature image */ add_theme_support('post-thumbnails'); /** * include the newscred api wrapper */ require_once NC_INCLUDE_PATH . "/newscred.php"; require_once NC_CONTROLLER_PATH . "/class-nc-settings.php"; /** * pre loaded objects * */ global $nc_utility, $nc_controller, $nc_cron; $nc_utility = NC_Utility::get_instance(); $nc_cron = NC_Cron::get_instance(); $nc_controller = NC_Controller::get_instance(); /** * pre loaded model objects * */ global $nc_source, $nc_topic, $nc_article, $nc_image, $nc_author, $nc_settings_api; $nc_author = NC_Author::get_instance(); $nc_source = NC_Source::get_instance(); $nc_topic = NC_Topic::get_instance(); $nc_article = NC_Article::get_instance(); $nc_image = NC_Image::get_instance(); $nc_settings_api = NC_Settings_API::get_instance();