register_autoloader(); /** * Init components. */ $this->init_components(); // Load translations. add_action( 'after_setup_theme', array( &$this, 'load_translations' ) ); } /** * Register autoloader. * * @since 1.0.0 * @access private * @throws \Exception Exception. */ private function register_autoloader() { // Get the autoloader. $loader = new Autoloader(); // Register the autoloader. $loader->register(); // Register the base directories for the namespace prefix. $loader->add_namespace( 'ElantaViewerCore', ELANTA_VIEWER_PATH . 'src' ); } /** * Init ElantaViewerCore components. * * @since 1.0.0 * @access private */ public function init_components() { // Enqueue all scripts and styles. $enqueue = new Enqueue(); $enqueue->init(); /** * ElantaViewerCore init. * * @since 1.0.0 */ do_action( 'elantaBuilder_viewer_init' ); } /** * Load plugin translations * * @return void */ public static function load_translations() { load_plugin_textdomain( 'elanta-viewer-light', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' ); } } Core::instance();