Exemplo n.º 1
0
/**
 * On plugins_loaded: load the minimum amount of essential files for this plugin
 */
function wpseo_init()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    // Make sure our option and meta value validation routines and default values are always registered and available.
    WPSEO_Options::get_instance();
    WPSEO_Meta::init();
    $options = WPSEO_Options::get_options(array('wpseo', 'wpseo_permalinks', 'wpseo_xml'));
    if (version_compare($options['version'], WPSEO_VERSION, '<')) {
        new WPSEO_Upgrade();
        // Get a cleaned up version of the $options.
        $options = WPSEO_Options::get_options(array('wpseo', 'wpseo_permalinks', 'wpseo_xml'));
    }
    if ($options['stripcategorybase'] === true) {
        $GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
    }
    if ($options['enablexmlsitemap'] === true) {
        $GLOBALS['wpseo_sitemaps'] = new WPSEO_Sitemaps();
    }
    if (!defined('DOING_AJAX') || !DOING_AJAX) {
        require_once WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php';
    }
    // Init it here because the filter must be present on the frontend as well or it won't work in the customizer.
    new WPSEO_Customizer();
}
Exemplo n.º 2
0
/**
 * On plugins_loaded: load the minimum amount of essential files for this plugin
 */
function wpseo_init()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    // Make sure our option and meta value validation routines and default values are always registered and available
    WPSEO_Options::get_instance();
    WPSEO_Meta::init();
    $options = WPSEO_Options::get_all();
    if (version_compare($options['version'], WPSEO_VERSION, '<')) {
        new WPSEO_Upgrade();
        // get a cleaned up version of the $options
        $options = WPSEO_Options::get_all();
    }
    if ($options['stripcategorybase'] === true) {
        $GLOBALS['wpseo_rewrite'] = new WPSEO_Rewrite();
    }
    if ($options['enablexmlsitemap'] === true) {
        $GLOBALS['wpseo_sitemaps'] = new WPSEO_Sitemaps();
    }
    if (!defined('DOING_AJAX') || !DOING_AJAX) {
        require_once WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php';
    }
}