Exemplo n.º 1
0
 /**
  * Public method to get the singleton instance
  *
  * @return Youxi_Builder_Manager
  */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new Youxi_Builder_Manager();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
function youxi_builder_plugins_loaded()
{
    global $wp_version;
    if (!defined('YOUXI_SHORTCODE_VERSION')) {
        if (!class_exists('Youxi_Admin_Notice')) {
            require plugin_dir_path(__FILE__) . 'class-admin-notice.php';
        }
        Youxi_Admin_Notice::instance()->add_error(__FILE__, __('This plugin requires you to install and activate the Youxi Shortcodes plugin.', 'youxi'));
        return;
    } else {
        if (version_compare(YOUXI_SHORTCODE_VERSION, '3.1', '<')) {
            if (!class_exists('Youxi_Admin_Notice')) {
                require plugin_dir_path(__FILE__) . 'class-admin-notice.php';
            }
            Youxi_Admin_Notice::instance()->add_error(__FILE__, __('The current version of this plugin requires at least Youxi Shortcode 3.1 to work.', 'youxi'));
            return;
        }
    }
    if (version_compare($wp_version, '4.3', '<')) {
        if (!class_exists('Youxi_Admin_Notice')) {
            require plugin_dir_path(__FILE__) . 'class-admin-notice.php';
        }
        Youxi_Admin_Notice::instance()->add_error(__FILE__, __('The current version of this plugin requires at least WordPress 4.3.', 'youxi'));
        return;
    }
    define('YOUXI_BUILDER_VERSION', '2.4.1');
    define('YOUXI_BUILDER_DIR', plugin_dir_path(__FILE__));
    define('YOUXI_BUILDER_URL', plugin_dir_url(__FILE__));
    define('YOUXI_BUILDER_LANG_DIR', dirname(plugin_basename(__FILE__)) . '/languages/');
    /* Load Language File */
    load_plugin_textdomain('youxi', false, YOUXI_BUILDER_LANG_DIR);
    /* Instantiate the manager */
    if (!class_exists('Youxi_Builder_Manager')) {
        require YOUXI_BUILDER_DIR . 'classes/class-manager.php';
    }
    Youxi_Builder_Manager::instance();
}