dir = dirname( $file ); $this->file = $file; $this->assets_dir = trailingslashit( $this->dir ) . 'assets'; $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $file ) ) ); $this->token = 'woothemes-archives'; $this->load_plugin_textdomain(); add_action( 'init', array( $this, 'load_localisation' ), 0 ); $this->timeline = new Woothemes_Archives_Timeline( $this->file ); $this->sitemap = new Woothemes_Archives_Sitemap( $this->file ); // Run this on activation. register_activation_hook( $this->file, array( $this, 'activation' ) ); } // End __construct() /** * Load the plugin's localisation file. * @access public * @since 1.0.0 * @return void */ public function load_localisation () { load_plugin_textdomain( 'woothemes-archives', false, dirname( plugin_basename( $this->file ) ) . '/lang/' ); } // End load_localisation() /** * Load the plugin textdomain from the main WordPress "languages" folder. * @since 1.0.0 * @return void */ public function load_plugin_textdomain () { $domain = 'woothemes-archives'; // The "plugin_locale" filter is also used in load_plugin_textdomain() $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' ); load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( $this->file ) ) . '/lang/' ); } // End load_plugin_textdomain() /** * Run on activation. * @access public * @since 1.0.0 * @return void */ public function activation () { $this->register_plugin_version(); } // End activation() /** * Register the plugin's version. * @access public * @since 1.0.0 * @return void */ private function register_plugin_version () { if ( $this->version != '' ) { update_option( 'woothemes-archives' . '-version', $this->version ); } } // End register_plugin_version() } // End Class