Esempio n. 1
0
 static function _init()
 {
     if (!is_user_logged_in() || apply_filters('front_end_editor_disable', false)) {
         return;
     }
     self::make_instances();
     if (self::$options->rich) {
         FEE_AlohaEditor::enqueue();
     }
     add_action('wp_head', array(__CLASS__, 'add_filters'), 100);
     add_action('wp_footer', array(__CLASS__, 'scripts'));
 }
 public static function enqueue()
 {
     $enable_debugging = defined('SCRIPT_DEBUG') && is_dir(dirname(FRONT_END_EDITOR_MAIN_FILE) . '/aloha-editor/');
     self::$alohaSrcBaseUrl = plugin_dir_url(FRONT_END_EDITOR_MAIN_FILE);
     self::$alohaSrcBaseUrl .= $enable_debugging ? 'aloha-editor/WebContent/' : 'aloha-build/';
     // Aloha 0.9.3 isn't compatible with newer versions of jQuery :(
     wp_deregister_script('jquery');
     wp_register_script('jquery', self::$alohaSrcBaseUrl . 'deps/jquery-1.4.2.js', array(), '1.4.2', false);
     if ($enable_debugging) {
         self::enqueue_debug();
     } else {
         self::enqueue_compressed();
     }
     self::enqueue_plugins();
     add_action('wp_head', array(__CLASS__, 'config'));
 }