Exemplo n.º 1
0
/**
 * Returns array of plugin files to be included in global scope.
 *
 * The default directory is nxt-content/plugins. To change the default directory
 * manually, define <code>nxt_PLUGIN_DIR</code> and <code>nxt_PLUGIN_URL</code>
 * in nxt-config.php.
 *
 * @access private
 * @since 3.0.0
 * @return array Files to include
 */
function nxt_get_active_and_valid_plugins()
{
    $plugins = array();
    $active_plugins = (array) get_option('active_plugins', array());
    // Check for hacks file if the option is enabled
    if (get_option('hack_file') && file_exists(ABSPATH . 'my-hacks.php')) {
        _deprecated_file('my-hacks.php', '1.5');
        array_unshift($plugins, ABSPATH . 'my-hacks.php');
    }
    if (empty($active_plugins) || defined('nxt_INSTALLING')) {
        return $plugins;
    }
    $network_plugins = is_multisite() ? nxt_get_active_network_plugins() : false;
    foreach ($active_plugins as $plugin) {
        if (!validate_file($plugin) && '.php' == substr($plugin, -4) && file_exists(nxt_PLUGIN_DIR . '/' . $plugin) && (!$network_plugins || !in_array(nxt_PLUGIN_DIR . '/' . $plugin, $network_plugins))) {
            $plugins[] = nxt_PLUGIN_DIR . '/' . $plugin;
        }
    }
    return $plugins;
}
Exemplo n.º 2
0
if (is_multisite()) {
    require ABSPATH . nxtINC . '/ms-functions.php';
    require ABSPATH . nxtINC . '/ms-default-filters.php';
    require ABSPATH . nxtINC . '/ms-deprecated.php';
}
// Define constants that rely on the API to obtain the default value.
// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
nxt_plugin_directory_constants();
// Load must-use plugins.
foreach (nxt_get_mu_plugins() as $mu_plugin) {
    include_once $mu_plugin;
}
unset($mu_plugin);
// Load network activated plugins.
if (is_multisite()) {
    foreach (nxt_get_active_network_plugins() as $network_plugin) {
        include_once $network_plugin;
    }
    unset($network_plugin);
}
do_action('muplugins_loaded');
if (is_multisite()) {
    ms_cookie_constants();
}
// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
nxt_cookie_constants();
// Define and enforce our SSL constants
nxt_ssl_constants();
// Create common globals.
require ABSPATH . nxtINC . '/vars.php';
// Make taxonomies and posts available to plugins and themes.