Пример #1
0
 /**
  * There are several WP bugs that prevent correct activation in multisitie:
  *   http://core.trac.wordpress.org/ticket/14170
  *   http://core.trac.wordpress.org/ticket/14718)
  * These bugs have been open for months.  A workaround is to just 'activate' the plugin whenever it runs
  * (the tables are only created if they don't exist already)
  *
  */
 function init()
 {
     // Load text domain
     load_plugin_textdomain('mappress', false, dirname(self::$basename) . '/languages');
     // Register hooks and create database tables
     Mappress_Map::register();
     // Register static classes
     if (class_exists('Mappress_Pro')) {
         Mappress_Icons::register();
         Mappress_Query::register();
     }
     // Check if upgrade is needed
     $current_version = get_option('mappress_version');
     if ($current_version < '2.38.2') {
         self::$options->metaKeys = array(self::$options->metaKey);
         self::$options->save();
     }
     update_option('mappress_version', self::VERSION);
 }