示例#1
0
function _manually_load_plugin()
{
    require dirname(__FILE__) . '/../es-wp-query.php';
    if (file_exists(dirname(__FILE__) . '/es.php')) {
        require_once dirname(__FILE__) . '/es.php';
    } elseif (getenv('TRAVIS')) {
        es_wp_query_load_adapter('travis');
    } else {
        echo "\n\nSetup Required\n" . "===========================================================\n" . "You must add an adapter to the plugin for this to work.\n" . "You can add it to the plugin in es-wp-query/tests/es.php\n" . "or elsewhere in your code using es_wp_query_load_adapter().\n" . "See the readme for more details.\n\n";
        exit(1);
    }
}
<?php

// On WordPress.com, we always want to load the 'wpcom-vip' adapter
es_wp_query_load_adapter('wpcom-vip');