/**
* Loads the MailChimp for WP plugin files
*
* @return boolean True if the plugin files were loaded, false otherwise.
*/
function mc4wp_load_plugin()
{
    // don't load plugin if user has the premium version installed and activated
    if (defined('MC4WP_VERSION')) {
        return false;
    }
    // bootstrap the lite plugin
    define('MC4WP_LITE_VERSION', '2.3.15');
    define('MC4WP_LITE_PLUGIN_DIR', dirname(__FILE__) . '/');
    define('MC4WP_LITE_PLUGIN_URL', plugins_url('/', __FILE__));
    define('MC4WP_LITE_PLUGIN_FILE', __FILE__);
    require_once MC4WP_LITE_PLUGIN_DIR . 'vendor/autoload_52.php';
    require_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions/general.php';
    require_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions/template.php';
    // Initialize admin section of plugin
    if (is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
        new MC4WP_Lite_Admin();
    }
    // Initialize the plugin and store an instance in the global scope
    MC4WP_Lite::init();
    $GLOBALS['mc4wp'] = MC4WP_Lite::instance();
    // Doing cron?
    if (defined('DOING_CRON') && DOING_CRON) {
        MC4WP_Usage_Tracking::instance()->add_hooks();
    }
    return true;
}
示例#2
0
/**
* Loads the MailChimp for WP plugin files
*
* @return boolean True if the plugin files were loaded, false otherwise.
*/
function mc4wp_load_plugin()
{
    // don't load plugin if user has the premium version installed and activated
    if (defined('MC4WP_VERSION')) {
        return false;
    }
    // bootstrap the lite plugin
    define('MC4WP_LITE_VERSION', '2.2.9');
    define('MC4WP_LITE_PLUGIN_DIR', plugin_dir_path(__FILE__));
    define('MC4WP_LITE_PLUGIN_URL', plugins_url('/', __FILE__));
    define('MC4WP_LITE_PLUGIN_FILE', __FILE__);
    require_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions/general.php';
    require_once MC4WP_LITE_PLUGIN_DIR . 'includes/functions/template.php';
    require_once MC4WP_LITE_PLUGIN_DIR . 'includes/class-plugin.php';
    // Initialize the plugin and store an instance in the global scope
    MC4WP_Lite::init();
    $GLOBALS['mc4wp'] = MC4WP_Lite::instance();
    if (is_admin() && (false === defined('DOING_AJAX') || false === DOING_AJAX)) {
        // ADMIN
        require_once MC4WP_LITE_PLUGIN_DIR . 'includes/class-admin.php';
        new MC4WP_Lite_Admin();
    }
    return true;
}