fileManager = new FileManager( $mainFile, 'premmerce' ); $this->registerThemeDirectory(); add_action( 'init', array( $this, 'loadTextDomain' ) ); } /** * Run plugin part */ public function run() { $container = new Container( $this->fileManager ); if ( is_admin() ) { new Admin( $container ); } ( new Settings() )->addActions(); $container->getAddonsManager()->init(); } public function registerThemeDirectory() { $theme = wp_get_theme( 'saleszone-premium' ); if ( $theme->exists() ) { register_theme_directory( $theme->get_template_directory() . '/child-themes' ); } } /** * Load plugin translations */ public function loadTextDomain() { $name = $this->fileManager->getPluginName(); load_plugin_textdomain( 'premmerce', false, $name . '/languages/' ); } /** * Fired when the plugin is activated */ public function activate() { update_option( self::VERSION_OPTION, $this->version, true ); update_option( Settings::OPTIONS_KEY, array( 'transliterate_slugs' => 'on', ), true ); } /** * Fired when the plugin is deactivated */ public function deactivate() { } /** * Fired during plugin uninstall */ public static function uninstall() { delete_option( self::VERSION_OPTION ); delete_option( WizardApi::KEY_POSITIONS ); delete_option( WizardApi::KEY_STATES ); delete_option( WizardApi::KEY_SWITCHER_STATE ); } }