init(); } return self::$instance; } /** * Holds the sites data. * * @var null */ private function init() { $this->setup_editor(); $this->setup_beaver(); $this->setup_elementor(); $this->setup_sites_listing(); if ( ! $this->should_load() ) { return; } $this->setup_admin(); $this->setup_api(); } /** * Utility to check if sites library should be loaded. * * @return bool */ private function should_load() { if ( ! current_user_can( 'manage_options' ) ) { return false; } return true; } /** * Setup sites listing. * * @return void */ private function setup_sites_listing() { $this->sites_listing = new Sites_Listing(); $this->sites_listing->init(); } /** * Setup admin functionality. * * @return void */ private function setup_admin() { $this->admin = new Admin(); $this->admin->init(); } /** * Setup editor functionality. * * @return void */ private function setup_editor() { $this->editor = new Editor(); $this->editor->init(); } /** * Setup beaver functionality. * * @return void */ private function setup_beaver() { if ( ! class_exists( 'FLBuilder' ) ) { return; } $this->beaver = new TI_Beaver(); $this->beaver->init(); } /** * Setup Elementor functionality. * * @return void */ private function setup_elementor() { $this->elementor = new Elementor(); $this->elementor->init(); } /** * Setup the restful functionality. * * * @return void */ private function setup_api() { $api = new Rest_Server(); $api->init(); } /** * Disallow object clone * * @access public * @return void * @since 1.0.0 */ public function __clone() { } /** * Disable un-serializing * * @access public * @return void * @since 1.0.0 */ public function __wakeup() { } }