Ejemplo n.º 1
0
 /**
  * Main Instance
  *
  * @return object
  */
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     parent::__construct(dirname(dirname(__FILE__)));
     include_once $this->getBaseDir() . '/vendor/autoload.php';
     $this->lessParser = new Less_Parser();
     $this->iconRepository = new Fac_IconRepository();
     $this->settings = Fac_Settings::instance($this);
     if ($this->isActiveModule('m_shortcodes')) {
         include_once $this->getBaseDir() . '/types/shortcodes-post-type.php';
     }
     if ($this->isActiveModule('m_sliders')) {
         include_once $this->getBaseDir() . '/types/sliders-post-type.php';
     }
     if ($this->isActiveModule('m_visual_constructor')) {
         $this->constructor = Fac_Constructor::instance();
     }
     if ($this->isActiveModule('m_shortcodes')) {
         $this->shortcodes = Fac_Shortcodes::instance();
     }
     $this->ajax = Fac_Ajax::instance();
     if ($this->isActiveModule('m_sliders')) {
         $this->slider = Fac_Slider::instance();
     }
     if ($this->isActiveModule('m_tax_icons')) {
         $this->taxonomyIcons = Fac_TaxonomyIcons::instance();
     }
     if ($this->isActiveModule('m_menu_icons')) {
         $this->menuIcons = Fac_MenuIcons::instance();
     }
     add_action('init', array($this, 'registerShortcodes'), 998);
     add_action('init', array($this, 'init'), 999);
     add_action('wp_enqueue_scripts', array($this, 'enqueueScripts'));
     add_action('admin_enqueue_scripts', array($this, 'enqueueAdminScripts'));
     add_action('widgets_init', array($this, 'initWidgets'));
     add_action('admin_init', array($this, 'facTinyMCEButtons'));
     add_action('wp_print_scripts', array($this, 'facFooter'));
     //add_filter( 'widget_text', 'do_shortcode' );
 }