Beispiel #1
0
function emember_handle_new_blog_creation($blog_id, $user_id, $domain, $path, $site_id, $meta)
{
    global $wpdb;
    if (is_plugin_active_for_network(WP_EMEMBER_FOLDER . '/wp_eMember.php')) {
        $old_blog = $wpdb->blogid;
        switch_to_blog($blog_id);
        wp_emember_installer();
        wp_emember_upgrader();
        wp_emember_initialize_db();
        switch_to_blog($old_blog);
    }
}
Beispiel #2
0
function wp_emember_activate()
{
    global $wpdb;
    if (function_exists('is_multisite') && is_multisite()) {
        // check if it is a network activation - if so, run the activation function for each blog id
        if (isset($_GET['networkwide']) && $_GET['networkwide'] == 1) {
            $old_blog = $wpdb->blogid;
            // Get all blog ids
            $blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
            foreach ($blogids as $blog_id) {
                switch_to_blog($blog_id);
                wp_emember_installer();
                wp_emember_upgrader();
                wp_emember_initialize_db();
            }
            switch_to_blog($old_blog);
            return;
        }
    }
    wp_emember_installer();
    wp_emember_upgrader();
    wp_emember_initialize_db();
}