コード例 #1
0
 /**
  * constructor
  *
  * @since 0.1
  */
 public function __construct()
 {
     require_once PLL_INC . '/functions-wpcom-vip.php';
     // VIP functions
     spl_autoload_register(array($this, 'autoload'));
     // autoload classes
     $install = new PLL_Install(POLYLANG_BASENAME);
     // stopping here if we are going to deactivate the plugin ( avoids breaking rewrite rules )
     if ($install->is_deactivation()) {
         return;
     }
     // plugin initialization
     // take no action before all plugins are loaded
     add_action('plugins_loaded', array($this, 'init'), 1);
     // override load text domain waiting for the language to be defined
     // here for plugins which load text domain as soon as loaded :(
     if (!defined('PLL_OLT') || PLL_OLT) {
         PLL_OLT_Manager::instance();
     }
     // extra code for compatibility with some plugins
     // loaded as soon as possible as we may need to act before other plugins are loaded
     if (!defined('PLL_PLUGINS_COMPAT') || PLL_PLUGINS_COMPAT) {
         PLL_Plugins_Compat::instance();
     }
 }
コード例 #2
0
ファイル: polylang.php プロジェクト: raheenbabul/flaming-lana
 public function __construct()
 {
     // FIXME maybe not available on every installations but widely used by WP plugins
     spl_autoload_register(array(&$this, 'autoload'));
     // autoload classes
     $install = new PLL_Install(POLYLANG_BASENAME);
     // stopping here if we are going to deactivate the plugin (avoids breaking rewrite rules)
     if ($install->is_deactivation()) {
         return;
     }
     // plugin initialization
     // take no action before all plugins are loaded
     add_action('plugins_loaded', array(&$this, 'init'), 1);
     // override load text domain waiting for the language to be defined
     // here for plugins which load text domain as soon as loaded :(
     if (!defined('PLL_OLT') || PLL_OLT) {
         PLL_OLT_Manager::instance();
     }
     // loads the API
     require_once PLL_INC . '/api.php';
     // WPML API
     if (!defined('PLL_WPML_COMPAT') || PLL_WPML_COMPAT) {
         PLL_WPML_Compat::instance();
     }
     // extra code for compatibility with some plugins
     if (!defined('PLL_PLUGINS_COMPAT') || PLL_PLUGINS_COMPAT) {
         PLL_Plugins_Compat::instance();
     }
 }
コード例 #3
0
ファイル: olt-manager.php プロジェクト: JoryHogeveen/polylang
 /**
  * Access to the single instance of the class
  *
  * @since 1.7
  *
  * @return object
  */
 public static function instance()
 {
     if (empty(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }