Ejemplo n.º 1
0
 /**
  * Initialize
  */
 public function init()
 {
     // Load external libraries
     require_once 'vendor/vafpress/bootstrap.php';
     require_once 'vendor/taxonomy-metadata/Taxonomy_MetaData.php';
     // Update plugin version
     update_option($this->pluginName . '_version', WPURP_VERSION);
     // Set core directory, URL and main plugin file
     $this->corePath = str_replace('/wp-ultimate-recipe.php', '', plugin_basename(__FILE__));
     $this->coreDir = apply_filters('wpurp_core_dir', WP_PLUGIN_DIR . '/' . $this->corePath);
     $this->coreUrl = apply_filters('wpurp_core_url', plugins_url() . '/' . $this->corePath);
     $this->pluginFile = apply_filters('wpurp_plugin_file', __FILE__);
     // Load textdomain
     if (!self::is_premium_active()) {
         $domain = 'wp-ultimate-recipe';
         $locale = apply_filters('plugin_locale', get_locale(), $domain);
         load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
         load_plugin_textdomain($domain, false, $this->corePath . '/lang/');
     }
     // Add core helper directory
     $this->add_helper_directory($this->coreDir . '/helpers');
     // Migrate first if needed
     $this->helper('migration');
     // Load required helpers
     $this->helper('ajax');
     $this->helper('activate');
     //$this->helper( 'admin_tour' );
     $this->helper('cache');
     $this->helper('compatibility');
     $this->helper('css');
     $this->helper('faq');
     $this->helper('notices');
     $this->helper('permalinks_flusher');
     $this->helper('plugin_action_link');
     $this->helper('query_posts');
     $this->helper('recipe_content');
     $this->helper('recipe_demo');
     $this->helper('recipe_meta_box');
     $this->helper('recipe_post_type');
     $this->helper('recipe_save');
     $this->helper('search');
     $this->helper('support_tab');
     $this->helper('taxonomies');
     $this->helper('thumbnails');
     $this->helper('vafpress_menu');
     $this->helper('vafpress_shortcode');
     $this->helper('shortcodes/index_shortcode');
     $this->helper('shortcodes/recipe_shortcode');
     // Include required helpers but don't instantiate
     $this->include_helper('addons/addon');
     $this->include_helper('addons/premium_addon');
     $this->include_helper('models/recipe');
     if (!WPUltimateRecipe::minimal_mode()) {
         // Load core addons
         $this->helper('addon_loader')->load_addons($this->coreDir . '/addons');
         // Load default assets
         $this->helper('assets');
     }
 }