Exemple #1
0
function gwolle_gb_init()
{
    global $wpdb;
    $current_version = get_option('gwolle_gb_version');
    if ($current_version && version_compare($current_version, GWOLLE_GB_VER, '<')) {
        // Upgrade, if this version differs from what the database says.
        if (function_exists('is_multisite') && is_multisite()) {
            $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
            foreach ($blogids as $blog_id) {
                switch_to_blog($blog_id);
                gwolle_gb_upgrade();
                restore_current_blog();
            }
        } else {
            gwolle_gb_upgrade();
        }
    }
}
Exemple #2
0
function gwolle_gb_activation($networkwide)
{
    global $wpdb;
    $current_version = get_option('gwolle_gb_version');
    if (function_exists('is_multisite') && is_multisite()) {
        $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
        foreach ($blogids as $blog_id) {
            switch_to_blog($blog_id);
            if ($current_version == false) {
                gwolle_gb_install();
            } elseif ($current_version != GWOLLE_GB_VER) {
                gwolle_gb_upgrade();
            }
            restore_current_blog();
        }
    } else {
        if ($current_version == false) {
            gwolle_gb_install();
        } elseif ($current_version != GWOLLE_GB_VER) {
            gwolle_gb_upgrade();
        }
    }
}