/**
 * Runs on activation of the plugin.
 */
function _wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    wpseo_load_textdomain();
    // Make sure we have our translations available for the defaults
    WPSEO_Options::get_instance();
    if (!is_multisite()) {
        WPSEO_Options::initialize();
    } else {
        WPSEO_Options::maybe_set_multisite_defaults(true);
    }
    WPSEO_Options::ensure_options_exist();
    flush_rewrite_rules();
    wpseo_add_capabilities();
    WPSEO_Options::schedule_yoast_tracking(null, get_option('wpseo'));
    // Clear cache so the changes are obvious.
    WPSEO_Options::clear_cache();
    do_action('wpseo_activate');
}
/**
 * Runs on activation of the plugin.
 */
function _wpseo_activate()
{
    require_once WPSEO_PATH . 'inc/wpseo-functions.php';
    wpseo_load_textdomain();
    // Make sure we have our translations available for the defaults.
    WPSEO_Options::get_instance();
    if (!is_multisite()) {
        WPSEO_Options::initialize();
    } else {
        WPSEO_Options::maybe_set_multisite_defaults(true);
    }
    WPSEO_Options::ensure_options_exist();
    if (is_multisite() && ms_is_switched()) {
        delete_option('rewrite_rules');
    } else {
        add_action('shutdown', 'flush_rewrite_rules');
    }
    wpseo_add_capabilities();
    // Clear cache so the changes are obvious.
    WPSEO_Utils::clear_cache();
    do_action('wpseo_activate');
}
Esempio n. 3
0
 function _initialize_yoast()
 {
     wpseo_init();
     wpseo_admin_init();
     wpseo_load_textdomain();
     $options = WPSEO_Options::get_all();
     new WPSEO_Metabox();
     WPSEO_Metabox::translate_meta_boxes();
     if ($options['opengraph'] === true || $options['twitter'] === true || $options['googleplus'] === true) {
         new WPSEO_Social_Admin();
         WPSEO_Social_Admin::translate_meta_boxes();
     }
 }