Пример #1
0
 public static function init($pluginFilePath)
 {
     register_activation_hook($pluginFilePath, array(__CLASS__, 'install'));
     register_uninstall_hook($pluginFilePath, array(__CLASS__, 'uninstall'));
     add_action('init', array('CMA_Update', 'run'), 0);
     add_action('widgets_init', array('CMA_AnswerController', 'registerSidebars'));
     // Check licensing API before controller init
     $licensingApi = new CMA_Cminds_Licensing_API('CM Answers Pro', CMA_Thread::ADMIN_MENU, 'CM Answers Pro', CMA_PLUGIN_FILE, array('release-notes' => 'http://answers.cminds.com/release-notes/'), '', array('CM Answers Pro'));
     self::$isLicenseOk = $licensingApi->isLicenseOk();
     CMA_Labels::bootstrap();
     CMA_Thread::init();
     add_action('plugins_loaded', array('CMA_BuddyPress', 'bootstrap'));
     add_action('init', array('CMA_BaseController', 'bootstrap'));
     add_action('wp_enqueue_scripts', array(__CLASS__, 'enable_scripts'));
     add_action('admin_enqueue_scripts', array(__CLASS__, 'enable_admin_scripts'));
     add_action('wp_head', array(__CLASS__, 'add_base_url'));
     add_filter('bp_blogs_record_comment_post_types', array(get_class(), 'bp_record_my_custom_post_type_comments'));
     add_filter('plugin_action_links_' . CMA_PLUGINNAME, array(__CLASS__, 'cma_settings_link'));
     add_filter('cm_micropayments_integrations', function ($a = array()) {
         if (!is_array($a)) {
             $a = array();
         }
         $a[] = 'CM Answers Pro';
         return $a;
     });
     add_action('plugins_loaded', array(__CLASS__, 'cm_lang_init'));
 }